当前位置: 首页 > 网络学院 > 网页制作基础教程 > CSS > CSS font属性
The font property is, with exception of some system fonts, a shorthand property for setting all of the properties for a font in one declaration.
font属性除了那些系统字体可以设置以外,还可以用速记的方法将所有针对字体的属性都在一句声明中设置好。
Note: This property also has a sixth value: "line-height", which sets the space between lines.
注意:这个属性还可以有第六个值:"line-height",可以用来设置行与行之间的距离
Inherited: Yes
继承性:有
p { font: 12px arial } p { font: oblique small-caps 900 12px/14px arial } p |
值 | 描述 |
---|---|
font-style font-variant font-weight font-size/line-height font-family | Sets the properties for a font. The line-height value sets the space between lines. The value can be a number, a %, or a font size 设置字体的多个属性。line-height可用来设置行与行之间的距离,这个值可以是数字,百分比,或是字体大小 |
caption | Defines the font that are used by captioned controls (like buttons, drop-downs, etc.) 定义用在控件上的说明文字(比如按钮,下拉列表,等等) |
icon | Defines the fonts that are used by icon labels 定义画像标签的文字字体 |
menu | Defines the fonts that are used by dropdown menus 定义下拉菜单的文字字体 |
message-box | Defines the fonts that are used by dialog boxes 定义使用在对话框上的文字字体 |
small-caption | |
status-bar | Defines the fonts that are used by window status bars 定义使用在窗口状态栏上的文字字体 |