gpt4 book ai didi

svg - 宽度和高度在 SVG 元素中不起作用

转载 作者:行者123 更新时间:2023-12-03 18:30:30 25 4
gpt4 key购买 nike

我尝试使用不同大小重复相同的 use 元素,但它不起作用:

<svg id="svg">
<defs>
<g id="phone"><path d="M19.494,0H7.948C6.843,0,5.951,0.896,5.951,1.999v23.446c0,1.102,0.892,1.997,1.997,1.997h11.546
c1.103,0,1.997-0.895,1.997-1.997V1.999C21.491,0.896,20.597,0,19.494,0z M10.872,1.214h5.7c0.144,0,0.261,0.215,0.261,0.481
s-0.117,0.482-0.261,0.482h-5.7c-0.145,0-0.26-0.216-0.26-0.482C10.612,1.429,10.727,1.214,10.872,1.214z M13.722,25.469
c-0.703,0-1.275-0.572-1.275-1.276s0.572-1.274,1.275-1.274c0.701,0,1.273,0.57,1.273,1.274S14.423,25.469,13.722,25.469z
M19.995,21.1H7.448V3.373h12.547V21.1z"/></g>
</defs>
<use href="#phone" class="tool-icon" width="50px" height="50px"/>
<use href="#phone" class="tool-icon" width="200px" height="200px" x="60px"/>
</svg>

我究竟做错了什么?

最佳答案

宽度和高度对使用元素没有影响,除非引用的元素有一个 View 框

关于svg - 宽度和高度在 SVG <use> 元素中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65284158/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com