文字控制

font-style:normal | italic | oblique

默认值:normal

取值:

normal:

指定文本字体样式为正常的字体

italic:

指定文本字体样式为斜体。对于没有斜体变量的特殊字体,将应用oblique

oblique:

指定文本字体样式为倾斜的字体

font-weight:normal | bold | bolder | lighter | <integer>

默认值:normal

取值:

normal:

正常的字体。相当于number为400

bold:

粗体。相当于number为700。

bolder:

特粗体。也相当于strong和b对象的作用

lighter:

细体

<integer>

用数字表示文本字体粗细。取值范围:100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900

说明:

设置或检索对象中的文本字体的粗细。

  • 作用由客户端系统安装的字体的特定字体变量映射决定。系统选择最近的匹配。也就是说,用户可能看不到不同值之间的差异。
  • 对应的脚本特性为fontWeight

font-size:<absolute-size> | <relative-size> | <length> | <percentage>

默认值:medium

取值:

<absolute-size>:

根据对象字体进行调节。可选参数值:xx-small | x-small | small | medium | large | x-large | xx-large

<relative-size>:

相对于父对像中字体尺寸进行相对调节。使用成比例的em单位计算。可选参数值:smaller | larger

<length>

用长度值指定文字大小。不允许负值。

<percentage>

用百分比指定文字大小。其百分比取值是基于父对象中字体的尺寸。不允许负值。

说明:

设置或检索对象中的字体尺寸。

  • 对应的脚本特性为fontSize

font:[ [ <font-style> || <font-variant> || <font-weight> ]? <font-size> [ / <line-height> ]? <font-family> ] | caption | icon | menu | message-box | small-caption | status-bar

默认值:看独立属性自身

取值:

<font-style>

指定文本字体样式

<font-variant>

指定文本是否为小型的大写字母

<font-weight>

指定文本字体的粗细

<font-size>

指定文本字体尺寸

<line-height>

指定文本字体的行高

<font-family>

指定文本使用某个字体或字体序列

caption:

使用有标题的系统控件的文本字体(如按钮,菜单等)(CSS2)

icon:

使用图标标签的字体(CSS2)

menu:

使用菜单的字体(CSS2)

message-box:

使用信息对话框的文本字体(CSS2)

small-caption:

使用小控件的字体(CSS2)

status-bar:

使用窗口状态栏的字体(CSS2)

猜你喜欢

转载自blog.csdn.net/qq_34608447/article/details/88621085