当前位置:网站首页>The difference between EM and REM
The difference between EM and REM
2022-07-22 13:07:00 【The life of elephants and ants】
- px It's fixed pixels , Once set, it cannot be changed because it adapts to the page .
- em yes rem be relative to px More flexibility , They change with respect to the unit of length , More suitable for responsive layout .
em Relative to the parent element
rem Relative to the root element
em Specific analysis of :
Sub element font size of em Is the font size relative to the parent element
Elemental width/height/padding/margin use em Relative to the element font-size.
rem Specific analysis :
rem Is that the whole length is equivalent to the root element , Who is the root element ? Elements
The usual way is to give html Element to set a font size , Then the length unit of other elements is rem.
html {
font-size: 10px;
}
边栏推荐
- el-input 失去焦点事件
- The logic of archives | important concepts in archives classification
- 超干货!彻底搞懂单工、半双工、全双工的区别与联系
- mapMutations在项目中的使用
- 【技术】uniapp 之引入 u-charts 部分demo
- [2022 national games simulation] minimum spanning tree - Kruskal, matrix, tree section dynamic DP
- A-loam source code reading
- Day04 Zen path - from install to uninstall
- mapState
- requests库中使用response.json()报错:json.decoder.JSONDecodeError: Expecting value
猜你喜欢
ACL-IJCAI-SIGIR顶级会议论文报告会(AIS 2022)笔记2:分析与可解释性
requests库中使用response.json()报错:json.decoder.JSONDecodeError: Expecting value
Day04 Zen path - from install to uninstall
安科瑞智能小型断路器改如何选型?
A-loam source code reading
What are the characteristics of ball screen projection with different implementation methods
[ kitex 源码解读 ] Kitex 扩展性设计思路
透过Redis源码探究Hash表的实现
华为无线设备配置WIDS和WIPS
2022.07.18
随机推荐
【开源的串口可视化工具——Serial Studio】
IOOutputStream类型
小程序毕设作品之微信酒店预订小程序毕业设计(4)开题报告
requests库中使用response.json()报错:json.decoder.JSONDecodeError: Expecting value
MATLAB数字图像处理 大作业:人脸表情识别
档案的逻辑 | 档案分类中的重要概念
【泛微ecology】compiling _jsp/_login/_upgrademessage...
Ioinputstream type
Ten year structure five year Life-04 the first turning point of work
2022山东健康展,健康产业展,DJK中国健博会,睡眠健康展
2022.07.20
安科瑞智能小型断路器改如何选型?
多重背包笔记
使用JDBC操作数据库数据库操作
Anaconda环境下Pycharm的配置
How to solve the problem that PIP command display is not internal or external command in Anaconda
2022.07.20
SeekTiger的Okaleido有大动作,生态通证STI会借此爆发?
B端产品经理学习:导入模板设计
Iooutputstream type