Skip to content

第 115 期(W3C标准-CSS-语法):CSS 单位 #118

Open

Description

@wingmeng

通用单位:

  • px:像素(Pixels),绝对长度单位
  • pt:点(Points),绝对长度单位
  • pc:派卡(Picas),绝对长度单位,默认为浏览器缺省字体大小(16px)
  • em:相对长度单位,相对于当前对象内文本的字体尺寸
  • ex:相对长度单位,相对于字符“x”的高度,通常为字体高度的一半
  • cm:厘米(Centimeters),绝对长度单位
  • mm:毫米(Millimeters),绝对长度单位
  • in:英寸(Inches),绝对长度单位

换算关系:

  • 1pc = 12pt = 16px
  • 1in = 2.54cm = 25.4mm = 72pt = 6pc = 96px

    注:以 72 像素/英寸为基准

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions