css 字体

211 阅读1分钟

[TOC]

css 字体

  • font-size font-size 决定文字的大小
    • 常用设置 数字+单位 百分比
  • font-family
  • font-weight
  • line-height
  • font 缩写属性

font-variant 可以影响小写字母的显示形式

font-family(重要,不过一般仅设置一次)

font-weight 字体粗细

normal 400 | bold 700

font-style

line-height

顶线 中线 基线 底线

line-height 的基本理解 一行文本所占的高度 严格定义:两行文字基线之间的间距

font 缩写属性

顺序:dont-style font-variant font-weight font-size/line-height font-family

规则: font-style、font-variant、font-weight 可以随意调换顺序,也可以省略 /line-height 可以省略,如果不省略,必须跟在 font-size 后面 font-size、font-family 不可以调换顺序,不可以省略