在 HTML 中使用 'px' 作为内联 SVG 的单位
Using 'px' as a unit on inline SVGs in HTML
我可以使用 px
作为内嵌 svg 图像的单位吗?例如,在下面的示例代码中使用 width="100px"
和 height="100px"
是否正确?
<svg width="100px" height="100px">
<circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow" />
</svg>
我可以使用 px
作为内嵌 svg 图像的单位吗?例如,在下面的示例代码中使用 width="100px"
和 height="100px"
是否正确?
<svg width="100px" height="100px">
<circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow" />
</svg>