当前位置:网站首页>px em rem的区别
px em rem的区别
2022-07-04 05:31:00 【是张鱼小丸子鸭】
目录
px
相对长度单位,相对于显示器屏幕分辨率而言
存在浏览器不兼容问题
em
相对长度单位,相当于当前对象内文本字体尺寸
em值不固定,em会继承父元素的大小
容易造成字体设置混乱问题
如果他父级设置的font-size为10px,那么1em就等于父系的10px,2em就等于父系的20px,以此类推
我们一般不经常使用em,如果父级元素删除了,那么他会去寻找他的父级->父级,所以特别容易造成字体设置混乱问题
Rem
相对长度单位,相对于根节点html字体大小来计算,任意浏览器默认字体高都是16px
如果html根节点设置字体font-size为100px. 则1em=100px. 2em=200px. 跟父级字体无关
浏览器兼容性比较好
边栏推荐
- FreeRTOS 中 RISC-V-Qemu-virt_GCC 的 锁机制 分析
- 如何判断数组中是否含有某个元素
- Upper computer software development - log information is stored in the database based on log4net
- Google Chrome browser will support the function of selecting text translation
- 接地继电器DD-1/60
- LM small programmable controller software (based on CoDeSys) note 22: error 4268/4052
- Graduation design of small programs -- small programs of food and recipes
- Tutle clock improved version
- 如何使用postman实现简单的接口关联【增删改查】
- Descriptive analysis of data distribution characteristics (data exploration)
猜你喜欢

ANSYS command
![[technology development -25]: integration technology of radio and television network, Internet, telecommunication network and power grid](/img/87/e0469e280365ed0261e2b551ebd888.png)
[technology development -25]: integration technology of radio and television network, Internet, telecommunication network and power grid
![[MySQL practice of massive data with high concurrency, high performance and high availability -8] - transaction isolation mechanism of InnoDB](/img/8e/90d08d22a2d340242be2357f662ea4.jpg)
[MySQL practice of massive data with high concurrency, high performance and high availability -8] - transaction isolation mechanism of InnoDB

(4) Canal multi instance use

BUU-Crypto-Cipher

Analysis of classical pointer and array written test questions in C language

【雕爷学编程】Arduino动手做(105)---压电陶瓷振动模块

C语言简易学生管理系统(含源码)

数据标注是一块肥肉,盯上这块肉的不止中国丨曼孚科技

ansys命令
随机推荐
Wechat applet +php realizes authorized login
Notepad++ -- display related configurations
Overview of relevant subclasses of beanfactorypostprocessor and beanpostprocessor
[Excel] 数据透视图
Appearance of LabVIEW error dialog box
Notepad++--显示相关的配置
Unity2D--人物移动并转身
ping端口神器psping
Arc135 a (time complexity analysis)
[paper summary] zero shot semantic segmentation
如何判断数组中是否含有某个元素
Excel 比较日器
Integer type of C language
2022 t elevator repair operation certificate examination question bank and simulation examination
tutle时钟改进版
How to clone objects
C # character similarity comparison general class
(4) Canal multi instance use
JS string splicing
BUU-Real-[PHP]XXE