CSS单位

em and rem: are often used to create scalable layouts, which maintain the vertical rhythm of the page even when the user changes the font size.

cap:Represents the "cap height" (nominal height of capital letters) of the element’s font.

ch:Represents the width, or more precisely the advance measure, of the glyph "0" (zero, the Unicode character U+0030) in the element's font

em:Represents the calculated font-size of the element. If used on the font-size property itself, it represents the inherited font-size of the element.

ex:Represents the x-height of the element's font. On fonts with the "x" letter, this is generally the height of lowercase letters in the font; 1ex ≈ 0.5em in many fonts.

ic:Equal to the used advance measure of the "水" (CJK water ideograph, U+6C34) glyph found in the font used to render it.lhEqual to the computed value of the line-height property of the element on which it is used, converted to an absolute length.

rem:Represents the font-size of the root element (typically <html>). When used within the root element font-size, it represents its initial value (a common browser default is 16px, but user-defined preferences may modify this).

rlh:Equal to the computed value of the line-height property on the root element (typically <html>), converted to an absolute length. When used on the font-size or line-height properties of the root element, it refers to the properties' initial value.

vh:Equal to 1% of the height of the viewport's initial containing block.

vw:Equal to 1% of the width of the viewport's initial containing block.

vi:Equal to 1% of the size of the initial containing block, in the direction of the root element’s inline axis.

vb:Equal to 1% of the size of the initial containing block, in the direction of the root element’s block axis.

vmin:Equal to the smaller of vw and vh.

vmax:Equal to the larger of vw and vh.

px:One pixel. For screen displays, it traditionally represents one device pixel (dot). However, for printers and high-resolution screens, one CSS pixel implies multiple device pixels. 1px = 1/96th of 1in.

cm:One centimeter. 1cm = 96px/2.54.

mm:One millimeter. 1mm = 1/10th of 1cm.

Q:One quarter of a millimeter. 1Q = 1/40th of 1cm.

in:One inch. 1in = 2.54cm = 96px.

pc:One pica. 1pc = 12pt = 1/6th of 1in.

pt:One point. 1pt = 1/72nd of 1in.

随机推荐

  1. webpack多入口优化

    最近接手的项目是公司之前搭的多页面应用脚手架,然后到现在入口页面大大小小超过半百了,然后每次更新完配置之后,重启页面就贼拉卡,实在太影响开发效率了,于是开始优化呗. 最开始发现如果你想要让加载速度变快 ...

  2. poj2182(线段树求序列第k小)

    题目链接:https://vjudge.net/problem/POJ-2182 题意:有n头牛,从1..n编号,乱序排成一列,给出第2..n个牛其前面有多少比它编号小的个数,记为a[i],求该序列的 ...

  3. Babel 6 概述

    babel-core 只转换语法(如箭头函数) babel-polyfill 由core-js和regenerator runtime组成. 1 core-js用来支持新的全局变量(例如 Promis ...

  4. VSCode的使用

    前后端分离的,先打开vs,打开你的项目,在项目根目录中找到.vs文件加,找到.vs\config\applicationhost.config,然后打开找到你项目的IIS Express配置,例如:& ...

  5. 为什么23种设计模式没有 MVC

    MVC的是为了把数据(Model)和视图(View)分离开来,然后用控制器(Controller)来粘合M和V之间的关系. MVC是观察者模式(Observer), 策略模式(Strategy)和组合 ...

  6. 对js原型及构造函数的相关理解

    一.js中的原型创建(声明)一个函数,浏览器在内存中会创建一个对象.每个函数都默认会有一个属性prototype指向了这个对象,就是说prototype的属性的值就是这个对象.此对象就是该函数的原型对 ...

  7. MySQL锁问题,事务隔离级别

    未完待续... 概述 这里专门指的是InnoDB存储引擎的锁问题和事务隔离级别. ========================================================= 锁 ...

  8. 从mysql主从复制到微信开源的phxsql

    严格的来说,微信开源的phxsql不是数据库,而是一个数据库的插件: 传统的互联网数据库结构一般是这样的: 服务访问数据库是通过分片来的: 除了这种基于hash的分片,还有一种基于range的分片方式 ...

  9. net::ERR_CONNECTION_RESET 问题排查

    后台服务器代码有问题 实体不对称,导致映射不对

  10. JS生成URL二维码

    需求:项目中需要在UI界面有一个二维码,扫码后可以跳转到二维码包含的URL. 解决方案:在前端用js生成一个包含URL等信息的二维码. 实现: 方案一. <!DOCTYPE HTML PUBLI ...