svg样式属性
本文借鉴:https://blog.csdn.net/iteye_5904/article/details/82672258
SVG的样式属性和CSS的语法非常接近,有时甚至是一样的,经常会照成一些使用上的混乱。
1.svg和CSS中不一样的样式属性
svg | 等效的CSS |
---|---|
fill | background-color或color |
fill-opacity | background-color或color设置rgba/hsla |
opacity | opacity |
stroke | border-color |
stroke-width | border-thickness |
stroke-opacity | border-color设置rgba |
rx, ry | border-radius |
2.svg和CSS中一样的样式属性
下面的属性在SVG和CSS中是一样的,只是在SVG的transformations和dimensions中稍有区别:
font-family, font-size, font-style, font-variant 和 font-weight
width 和 height
scale, rotate, skew