当前位置:网站首页>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. 跟父级字体无关
浏览器兼容性比较好
边栏推荐
- 2022 question bank and answers for safety management personnel of hazardous chemical business units
- Enterprise level log analysis system elk (if things backfire, there must be other arrangements)
- Arc135 a (time complexity analysis)
- 数据标注是一块肥肉,盯上这块肉的不止中国丨曼孚科技
- C language simple student management system (including source code)
- 724. 寻找数组的中心下标
- With the advent of the IP era, how can E-sports hotels take advantage of the "east wind" of games?
- left_and_right_net正常版本
- Flask
- 1.1 history of Statistics
猜你喜欢

空洞卷积、可变形卷积、可变形ROI Pooling

KMP match string

Introduction To AMBA 简单理解

Graduation design of small programs -- small programs of food and recipes

Overview of relevant subclasses of beanfactorypostprocessor and beanpostprocessor

Take you to quickly learn how to use qsort and simulate qsort
![[paper summary] zero shot semantic segmentation](/img/78/ee64118d86a7e43ec4d1cb97191fbe.jpg)
[paper summary] zero shot semantic segmentation

The data mark is a piece of fat meat, and it is not only China Manfu technology that focuses on this meat

Upper computer software development - log information is stored in the database based on log4net

724. 寻找数组的中心下标
随机推荐
2022 t elevator repair operation certificate examination question bank and simulation examination
How to configure static IP for Kali virtual machine
Excel 比较日器
Excel comparator
Kubernets first meeting
Wechat applet +php realizes authorized login
Halcon image calibration enables subsequent image processing to become the same as the template image
Notepad++--显示相关的配置
Simulink and Arduino serial port communication
BUU-Reverse-easyre
VB. Net calls ffmpeg to simply process video (class Library-6)
Risc-v-qemu-virt in FreeRTOS_ Lock mechanism analysis of GCC
The data mark is a piece of fat meat, and it is not only China Manfu technology that focuses on this meat
Tutle clock improved version
Introduction to AMBA
Kubernets first meeting
TCP state transition diagram
Flask
SQL performance optimization skills
Google Chrome browser will support the function of selecting text translation