一、font-style
font-style属性是用来设置字体样式的。
其默认值为normal,还可以选择 italic 和 oblique 来使字体倾斜。
<style type="text/css">
.one{font-style: normal;}
.two{font-style: italic;}
.three{font-style: oblique;}
</style>
虽然 italic 和 oblique 的效果看起来一样,但它们使字体倾斜的原理不同。
italic 是斜体样式,就是字体自带的斜体属性;oblique 是倾斜体样式,是使字体向右倾斜。
但是,并不是所有字体都具有斜体的样式,如果当前字体没有可用的斜体版本,会选用倾斜体(oblique)替代。反之,如果当前字体没有可用的倾斜体版本,会选用斜体(italic)替代。
二、font-variant
font-variant用于定义小型大写字母文本。
其默认值为normal,用small-caps可以显示小型大写字母的字体。
<style type="text/css">
.one{font-variant: normal;}
.two{font-variant: s