font-style
font-style
属性指定文本是使用常规、斜体还是倾斜字样来渲染。
注意:作为呈现属性,font-style
还有一个对应的 CSS 属性:font-style
。当两者都被指定时,CSS 属性具有优先权。
你可以将此属性与以下 SVG 元素一起使用
示例
控制 SVG 字体样式
html
<svg viewBox="0 0 250 30" xmlns="http://www.w3.org/2000/svg">
<text y="20" font-style="normal">Normal font style</text>
<text x="150" y="20" font-style="italic">Italic font style</text>
</svg>
用法说明
值 | normal | italic | oblique |
---|---|
默认值 | normal |
可动画的 | 是 |
关于这些值的描述,请参考 CSS font-style
属性。
规范
规范 |
---|
CSS 字体模块第 4 级 # font-style-prop |
浏览器兼容性
加载中…
另见
- CSS
font-style
属性