font color font-family font-size font-size-adjust font-stretch font-style font-weight text-decoration text-underline-position text-shadow font-variant text-transform line-height letter-spacing word-spacing
font
版本:CSS1/CSS2 兼容性:IE4+ NS4+ 继承性:有
语法:
font :
font-style ||
font-variant ||
font-weight ||
font-size ||
line-height ||
font-family
font : caption | icon | menu | message-box | small-caption | status-bar
font : caption | icon | menu | message-box | small-caption | status-bar
取值:
font-style | : | CSS1 | 请参阅 font-style 属性 |
font-variant | : | CSS1 | 请参阅 font-variant 属性 |
font-weight | : | CSS1 | 请参阅 font-weight 属性 |
font-size | : | CSS1 | 请参阅 font-size 属性 |
line-height | : | CSS1 | 请参阅 line-height 属性 |
font-family | : | CSS1 | 请参阅 font-family 属性 |
caption | : | CSS2 | 使用有标题的系统控件的文本字体(如按钮,菜单等) |
icon | : | CSS2 | 使用图标标签的字体 |
menu | : | CSS2 | 使用菜单的字体 |
message-box | : | CSS2 | 使用信息对话框的文本字体 |
small-caption | : | CSS2 | 使用小控件的字体 |
status-bar | : | CSS2 | 使用窗口状态栏的字体 |
说明:
设置或检索对象中的文本特性。该属性是复合属性。
默认值为: normal normal normal medium normal "Times New Roman" 。
第一种声明方式参数必须按照如上的排列顺序。每个参数仅允许有一个值。忽略的将使用其参数对应的独立属性的默认值。
对于如何使用用户端系统可能没有的字体,可以参阅 @font-face 规则。
对应的脚本特性为 font 。
默认值为: normal normal normal medium normal "Times New Roman" 。
第一种声明方式参数必须按照如上的排列顺序。每个参数仅允许有一个值。忽略的将使用其参数对应的独立属性的默认值。
对于如何使用用户端系统可能没有的字体,可以参阅 @font-face 规则。
对应的脚本特性为 font 。
示例:
p { font: italic small-caps 600 12pts/18pts 宋体; }
p { font: italic small-caps 600 12pts/150% Courier; }
p { font: italic small-caps 600 12pts/1.5 Courier; }
p { font: italic small-caps 600 12pts/18pts Courier; }
p { font: /18pts serif; }
p { font: oblique 100 24pts; }
H1 { font: 15pt/17pt bold "Arial" normal }
p { font: italic small-caps 600 12pts/150% Courier; }
p { font: italic small-caps 600 12pts/1.5 Courier; }
p { font: italic small-caps 600 12pts/18pts Courier; }
p { font: /18pts serif; }
p { font: oblique 100 24pts; }
H1 { font: 15pt/17pt bold "Arial" normal }
应用于:
IE4.0+ | AADDRESSBBIGBLOCKQUOTEBODYBUTTONCAPTIONCENTERCITECODECOLCOLGROUPDDDFNDIRDIVDLDTEMFIELDSETFORMHnHTMLIIMGINPUT type=buttonINPUT type=checkboxINPUT type=fileINPUT type=imageINPUT type=passwordINPUT type=radioINPUT type=resetINPUT type=submitINPUT type=textISINDEXKBDLABELLEGENDLILISTINGMARQUEEMENUOLPPLAINTEXTPRESSAMPSELECTSMALLSPANSTRIKESTRONGstyleSUBSUPTABLETBODYTDTEXTAREATFOOTTHTHEADTRTTUULVARXMP |
IE5.0+ | CUSTOMruntimeStyle |
IE5.5+ | defaults |