首页 > 开发 > CSS > 正文

css字体样式(Font Style) 属性

2024-07-11 08:36:52
字体:
来源:转载
供稿:网友

css文本样式

序号中文说明标记语法
1字体样式{font:font-style font-variant font-weight font-size font-family}
2字体类型{font-family:"字体1","字体2","字体3",…}
3字体大小{font-size:数值|inherit| medium| large| larger| x-large| xx-large| small| smaller| x-small| xx-small}
4字体风格{font-style:inherit|italic|normal|oblique}
5字体粗细 {font-weight:100-900|bold|bolder|lighter|normal;}
6字体颜色 {color:数值;}
7阴影颜色{text-shadow:16位色值}
8字体行高 {line-height:数值|inherit|normal;}
9字 间 距 {letter-spacing:数值|inherit|normal}
10单词间距{word-spacing:数值|inherit|normal}
11字体变形{font-variant:inherit|normal|small-cps }
12英文转换{text-transform:inherit|none|capitalize|uppercase|lowercase}
13{font-size-adjust:inherit|none}
14{font-stretch:condensed|expanded|extra-condensed|extra-expanded|inherit|narrower|normal| semi-condensed|semi-expanded|ultra-condensed|ultra-expanded|wider}

1. 字体样式:font

语法:{font:font-style font-variant font-weight font-size font-family}
   [ <字体风格> || <字体变形> || <字体加粗> ]? <字体大小> [ / <行高> ]? <字体类形>
作用:简写属性,提供了对字体所有属性进行设置的快捷方法。
注意:字体样式用作不同字体属性的略写,特别是行高。例如 P { font: italic bold 12pt/14pt Times, serif }指定该段为bold(粗体)和italic(斜体)Times或serif字体,12点大小,行高为14点。

例子:字体字体

2. 字体类形:font-family

语法:{font-family:字体1,字体2,字体3,…}

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表