CSS 字体样式

字体样式

font-style 属性主要用于指定斜体文本。

此属性可设置三个值:

  • normal – 文字正常显示
  • italic – 文本以斜体显示
  • oblique – 文本为“倾斜”(倾斜与斜体非常相似,但支持较少)

实例

p.normal {
  font-style: normal;
}

p.italic {
  font-style: italic;
}

p.oblique {
  font-style: oblique;
}

字体粗细

font-weight 属性指定字体的粗细:

实例

p.normal {
  font-weight: normal;
}

p.thick {
  font-weight: bold;
}

字体变体

font-variant 属性指定是否以 small-caps 字体(小型大写字母)显示文本。

在 small-caps 字体中,所有小写字母都将转换为大写字母。但是,转换后的大写字母的字体大小小于文本中原始大写字母的字体大小。

实例

p.normal {
  font-variant: normal;
}

p.small {
  font-variant: small-caps;
}

Related Tags:

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注