所有css字体属性的一个css声明

the*_*gah 12 css

将所有css字体属性放入一个值的正确语法是什么.

body {font: 12px, arial, red}
Run Code Online (Sandbox Code Playgroud)

类似的东西,但有所有选择器和属性.

Seb*_*lli 41

body{
    font: bold italic 15px/20px arial,sans-serif;
    color: red;
}
Run Code Online (Sandbox Code Playgroud)

http://www.w3schools.com/css/tryit.asp?filename=trycss_font

您不能将颜色包含在声明中.15px/20px = font-size/line-height 替代文字

很好的链接,maegar!


Har*_*men 5

font: [ [ <'font-style'> || <'font-variant'> || <'font-weight'> ]? <'font-size'> [ / <'line-height'> ]? <'font-family'> ] | caption | icon | menu | message-box | small-caption | status-bar | inherit
Run Code Online (Sandbox Code Playgroud)

来源:http : //www.w3.org/TR/CSS2/fonts.html#font-shorthand