rem布局样例
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" > <title>rem布局样例</title> <style> *{ margin: 0; padding: 0; box-sizing: border-box; } body{ background: #eef3f6; } .btndelete{ border: 0.01rem solid #fc5630; width: 1.1rem; height: 0.5rem; line-height: 0.5rem; background: none; color: #fc5630; border-radius: 0.25rem; outline: none; font-size: 0.28rem; } .wrap{ position: relative; padding-top: 1.2rem; } .wrap .bg{ position: absolute; top: 0; width: 100%; height: 3.5rem; background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAXcAAACvCAMAAAAxBG46AAABDlBMVEUAAAAmu/8bo/8ktv8dqP8dqP8grf8isP8svf8jtP8dp/8gqP8ttv8dqf8bo/8dp/8fqP8cpP8bo/8bpP8krv8dqP8bpP8epv8hqP8bpP8bo/8dpv8eqf8jrP8jr/8dp/8cp/9Awv8mr/80v/8isf+T0/9NyP8mu/8cpv8eqf8bov8hr/8ktv8muP8ks/8isv8frf8bo/8lrv8tuf8mqv8wuP8orv8gq/8psv8ru/8utf8rtP8zs/8xuv8iqf8msv8uvf8wrv8pq/88uf8gp/81t/86t/8usv8zvf8rr/9Hvf85wP8ysf9Auv9Etv8zuf85u/82u/9Mxf8+uf85sf9Dwf8+v/9Vxv9PwP9Muf+TqeyjAAAAJ3RSTlMA8PHw8Ajx8fDwE0rwevchwandlN8q6baI0G5XNNKkYUDwlvBtcvDVP9nCAAAgSklEQVR42tTc+27iRhgF8N7Ui9Q/+wKrlZogGENtwB6PjZ2wBgdCc2Fz6fu/SL+ZsTnY42sS6PaoEJtNG+mXr2cGA/vdH9835FfjuEs+/fnnn5+/f1d+1T/tx8+NP/UzfeOPnz99+vT9j+/Jbyo//v4b8jk7+b2cT7///tsvlN9/qc/PP9OtOX989/1FQzjHYXzRNdvHx8ftxZuDn8vZNmXHjzN2fMw4Z+k2DTkrZlQMHqmMlWUkLCS6l4+P/RnF1x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NiFMMH9sy7T+reb3AXru7cN0W+d6xHOXjVYfWSe7/fp7q75InxOVo7vD4/6Akvu49WvvEzd6sDu25wF62+833/4nCNs/7D2ctW5zCnDvA6uDN6i7vYifnkzNfXQmC/+ocC80KZg4d7GztpkepH345Pd2GOrB9eXJ1tShv2aZibOgGePnKXNjE7X7+cXG5BusF+9/R4b1Oeeub3RXv4Ut+pyV2S+tHe8SmmZW62Lrd5dKSpz+DteGyn7poa0hcyMbzm82veMjpc/BTDjiygDnjz9vY66zs1uq++7Lws2595zeOC4l+fn22sfNgR99pqXuGum91XpA7y03jy+uJ/3mb8lU4M0tcdO453X7o6yEtjngT/YGOV6lgabcbOHTNTc/8ZoZ5sy+OGJb75K5mY8sSPx8Fdf+y+/InZOdrbP6mSp8fnzb/a21iFOg67sxN3anNftjpKzruyBZ1lZ+tv+/bT2iAMhgEcxHmomMaqTfwvhYH0tiH0FkjIuadc9v2/yN54CS06bWeKXfdcev+9Dw9StKgpib2HToyBb6XiCtzZtLstdbQjUdZYKvn07kD1Y8/Os+N4JGs5RLbdqLtFdRC3OSvz9RNYfex+PmBiDDxTXAg57m5lYpyViF8MT5IHuvt2J8ZMPOcdE+Puy6qjfRrSulmX+PXy0LD0TlbVIUyorhV8zH2piUFOqiuebFYrfvnIU0D5SemeLKlDmBKSCcEG3X9TdtPwKMuL5wAf4I/C0vUWV4ecz6pjfBj+/rIjZ4dhUp6l4T/zJ37d199bjv2D6T9pWAfws90nvElIM/8pCz7HPwpx7LK71Y27On+B+zD8cYa6qXcU/Il+z9kfOACtSLl30Y3qJoJzJTT8vL4PaGd58wrcAwd42xZ+ntEoxGnsInnry9MM4Jm4gpdDfe+tU8CmWe0X25fUHjnBpr9BAEcg+gouQtP0soc3331I2R51wB05zh6kCVBDsXvrf+wZV4AzNH5eZ0FAaVSFhGCcpulOZw9xIPo3hpQQjAmpqsOBvuv4TZEA9JqlvwGfHyxR63iIgwAAAABJRU5ErkJggg==); background-repeat: no-repeat; background-size: 100% 100%; } .wrap .studetail{ height: 3.6rem; background: #fff; border-radius: 0.08rem; margin: 0 .2rem; position: relative; z-index: 1; box-shadow: 0px 0.03rem 0.1rem #ddd; overflow: hidden; } .wrap .studetail .btndelete{ position: absolute; top: 0.3rem; right: 0.3rem; } .wrap .studetail .studetail_top,.wrap .studetail .studetail_bottom{ display: flex; align-items: center; text-align: center; justify-content: center; } .wrap .studetail .studetail_top{ height: 2.6rem; font-size: 0.3rem; color: #333; } .wrap .studetail .studetail_top .stu_info{ height: 1.9rem; display: flex; flex-direction: column; justify-content: space-between; } .wrap .studetail .studetail_top .stu_info .img{ height: 1.4rem; width: 1.4rem; border: 0.06rem solid #c5e9fa; border-radius: 50%;; } .wrap .studetail .studetail_bottom{ height: 1rem; border-top: 0.01rem dashed #ddd; font-size: 0.26rem; color: #666; } .wrap .parent_box{ padding: 0 .2rem; } .wrap .parent_box .parent_title{ padding: 0.36rem 0 0.16rem; font-weight: bold; font-size: 0.28rem; color: #333; } .wrap .parent_box .parent_list .item:first-child{ border-top: 0.01rem solid #e1e7ec; } .wrap .parent_box .parent_list .item{ padding: 0 .24rem; height: 1rem; border-bottom: 0.01rem solid #e1e7ec; background: #fff; font-size: 0.28rem; color: #333; display: flex; align-items: center; justify-content: space-between; } .wrap .determine{ width: 3.4rem; line-height: 1rem; margin:0.6rem auto; color: #fff; border-radius: 0.5rem; font-size: 0.36rem; text-align: center; background: linear-gradient(to right, #fc8b05 , #fc7305); } </style> </head> <body> <div class="wrap"> <div class="bg"></div> <div class="studetail"> <button class="btndelete" type="button" name="button">移除</button> <div class="studetail_top"> <div class="stu_info"> <div class="img"></div> <div class="name">詹姆斯</div> </div> </div> <div class="studetail_bottom"> <div>三年二班的刘小,刘迪家长的孩子</div> </div> </div> <div class="parent_box"> <div class="parent_title">关联家长</div> <div class="parent_list"> <div class="item"> <div>刘吴迪(爸爸)</div> <div>13659646789</div> <button class="btndelete" type="button" name="button">移除</button> </div> <div class="item"> <div>刘吴迪(爸爸)</div> <div>13659646789</div> <button class="btndelete" type="button" name="button">移除</button> </div> <div class="item"> <div>刘吴迪(爸爸)</div> <div>13659646789</div> <button class="btndelete" type="button" name="button">移除</button> </div> </div> </div> <div class="determine"> 确 定 </div> </div> <script> // https://blog.csdn.net/TCF_JingFeng/article/details/80814015 /* 设计稿的宽度:designWidth 允许自适应的最大宽度(超过这个值屏幕元素不在自适应增大):maxWidth 页面顶部加上:<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" > 这段js的传入两个参数:一个为设计稿实际宽度,一个为显示的最大宽度(允许的屏幕最大宽度,用来限制屏幕过大之后元素还会自适应增大的) 例如设计稿为750,最大宽度为600,则为(750,600),屏幕大于600之后就不会自适应变大了,也相当于在用@media属性时min-width只设置到了600,没有后面的屏幕尺寸,就不会再变化了 公式:1rem = 浏览器屏幕宽(width) * 100 / 设计稿宽(designWidth) (750,750)含义1rem = clientWidth * 100 / 750 (750,2160)含义1rem = clientWidth * 100 / 750 clientWidth是动态获取的 后面的750和2160表示maxWidth,如果浏览器窗口(clientWidth)大于这个数值就将clientWidth设置成这个数值(maxWidth)。而width是根据屏幕变化动态获取的 */ ;(function (designWidth, maxWidth) { var doc = document, win = window, docEl = doc.documentElement, remStyle = document.createElement("style"), tid; function refreshRem() { var clientWidth = docEl.getBoundingClientRect().width;//获取document的宽度,浏览器屏幕宽度 // alert(clientWidth) maxWidth = maxWidth || 540;//短路运算符,如果前面式子为false再执行后面,如果赋值了maxWidth那么maxWidth=maxWidth,否则没有赋值那么maxWidth为false,就会执行maxWidth=540 clientWidth > maxWidth && (clientWidth = maxWidth);//短路运算符,如果前面式子true再执行后面 var rem = clientWidth * 100 / designWidth; remStyle.innerHTML = 'html{font-size:' + rem + 'px;}'; } if (docEl.firstElementChild) { docEl.firstElementChild.appendChild(remStyle); } else { var wrap = doc.createElement("div"); wrap.appendChild(remStyle); doc.write(wrap.innerHTML); wrap = null; } refreshRem(); //要等 wiewport 设置好后才能执行 refreshRem,不然 refreshRem 会执行2次; win.addEventListener("resize", function () { clearTimeout(tid); //防止执行两次 tid = setTimeout(refreshRem, 300); }, false); /* 浏览器后退的时候重新计算,为了查看页面是直接从服务器上载入还是从缓存中读取,你可以使用 PageTransitionEvent 对象的 persisted 属性来判断。 如果页面从浏览器的缓存中读取该属性返回 ture,否则返回 false */ win.addEventListener("pageshow", function (e) { if (e.persisted) { clearTimeout(tid); tid = setTimeout(refreshRem, 300); } }, false); /* 为什么一般多是 html{font-size:62.5%;} 而不是 html{font-size:10px;}呢? 因为有些浏览器默认的不是16px,或者用户修改了浏览器默认的字体大小(因浏览器分辨率大小,视力,习惯等因素)。 如果我们将其设置为10px,一定会影响在这些浏览器上的效果,所以最好用绝大多数用户默认的16作为基数 * 62.5% 得到我们需要的10px。 实际项目设置成 font-size: 62.5%可能会出现问题,因为chrome不支持小于12px的字体,计算小于12px的时候,会默认取12px去计算,导致chrome的em/rem计算不准确。 针对这个现象,可以尝试设置html字体为100px,body 修正为16px,这样 0.1rem 就是 10px,而body的字体仍然是默认大小,不影响未设置大小的元素的默认字体的大小。 */ if (doc.readyState === "complete") { doc.body.style.fontSize = "16px";//页面元素默认16px,如果不设置将是自动为16px显示 } else { doc.addEventListener("DOMContentLoaded", function (e) { doc.body.style.fontSize = "16px"; }, false); } })(750, 750); </script> </body> </html>