当前位置:网站首页>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. 跟父级字体无关
浏览器兼容性比较好
边栏推荐
- Unity2d -- character moves and turns
- Actual cases and optimization solutions of cloud native architecture
- Halcon image calibration enables subsequent image processing to become the same as the template image
- Evolution of system architecture: differences and connections between SOA and microservice architecture
- LM small programmable controller software (based on CoDeSys) note 22: error 4268/4052
- VB.net 简单的处理图片,黑白(类库——7)
- XII Golang others
- Etcd database source code analysis - initialization overview
- (4) Canal multi instance use
- Upper computer software development - log information is stored in the database based on log4net
猜你喜欢

Input displays the currently selected picture

Halcon图片标定,使得后续图片处理过后变成与模板图片一样

云原生架构实战案例及优化解决方案

Etcd database source code analysis - initialization overview

谷歌 Chrome 浏览器将支持选取文字翻译功能
![BUU-Crypto-[GUET-CTF2019]BabyRSA](/img/87/157066155e8d3a93e30a68eaf1781b.jpg)
BUU-Crypto-[GUET-CTF2019]BabyRSA

Steady! Huawei micro certification Huawei cloud computing service practice is stable!

KMP match string

Canoe panel learning video

Flask
随机推荐
[interested reading] advantageous filtering modeling on long term user behavior sequences for click through rate pre
How to clone objects
Basic concept of bus
Wechat applet +php realizes authorized login
What is MQ?
The data mark is a piece of fat meat, and it is not only China Manfu technology that focuses on this meat
724. Find the central subscript of the array
Programmers don't talk about morality, and use multithreading for Heisi's girlfriend
Simulink and Arduino serial port communication
2022g2 power station boiler stoker special operation certificate examination question bank and answers
Graduation design of small programs -- small programs of food and recipes
JS string splicing
input显示当前选择的图片
transformer坑了多少算力
left_and_right_net可解释性设计
js获取对象中嵌套的属性值
Zhanrui tankbang | jointly build, cooperate and win-win zhanrui core ecology
谷歌 Chrome 浏览器将支持选取文字翻译功能
2022年R2移动式压力容器充装复训题库及答案
PostgreSQL has officially surpassed mysql. Is this guy too strong!