font属性的综合写法

来自:互联网
时间:2020-05-09
阅读:

font属性的综合写法,书写顺序分别是:font-style font-variant font-weight font-size font-family。

实例:

.ziti {font:italic normal bold 18px arial;}

如果哪项属性是默认值,可以把他省略不写,系统会自动解析其为默认值。

font的取值有点复杂,取值主要分为两部分,现在举几个[ [ <font-style> || <font-variant> || <font-weight> ]? <font-size> [ / <line-height> ]? <font-family> ]取值的例子,如下:

p
{
    font:italic small-caps bold 12px/1.2em Arial;
}
返回顶部
顶部