我有以下 HTML:
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="10.5" cy="10.5" r="7.5"></circle>
<line x1="21" y1="21" x2="15.8" y2="15.8"></line>
</svg>
HTML 充其量看起来很笨重,我如何将它的属性转换为 CSS?
例如:
#search-svg {
width: 20;
height: 20;
viewBox: 0 0 24 24;
fill: none;
stroke: currentColor;
stroke-width: 2;
stroke-linecap: round;
stroke-linejoin: round
}
我知道width
,height
和fill
属性存在并且可以转换成 CSS。
但是我不知道其他属性是如何工作的或者它们的 CSS 等效项是什么,并且在caniuse上快速搜索不会产生以 . 开头的 CSS 属性的结果stroke
。
谢谢你。