1、小于某个宽度时固定
@media screen and (max-width:1372px){
body{
min-width: 1344px;
}
}
2、移动端适配
@media screen and (min-width:321px) and (max-width:375px){html,body {font-size:11px}}
@media screen and (min-width:376px) and (max-width:414px){html,body {font-size:12px}}
@media screen and (min-width:415px) and (max-width:639px){html,body{font-size:15px}}
@media screen and (min-width:640px) and (max-width:719px){html,body{font-size:20px}}
@media screen and (min-width:720px) and (max-width:749px){html,body{font-size:22.5px}}
@media screen and (min-width:750px) and (max-width:799px){html,body{font-size:23.5px}}
@media screen and (min-width:800px){html,body{font-size:25px}}
em:一般都是以<body>的“font-size”为基准。相对于父元素的属性而计算的.进行任何元素设置,都有可能需要知道他父元素的大小。
rem:相对于根元素<html>设置字体大小,只需要在根元素确定一个参考值。
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/13933.html