*新闻详情页*/>
css3英语的语法: (750px设计方案图的1rem = 100px)
@media only screen and (min-width: 320px) and (max-width: 479px){ html { font-size: 42.67px !important; } } @media only screen and (min-width: 480px) and (max-width: 639px){ html { font-size: 64px !important; } } @media only screen and (min-width: 640px) and (max-width: 749px){ html { font-size: 85.34px !important; } } @media only screen and (min-width: 750px) and (max-width: 959px){ html { font-size: 100px !important; } } @media only screen and (min-width: 960px) and (max-width: 1241px){ html { font-size: 128px !important; } } @media only screen and (min-width: 1242px){ html { font-size: 165.6px !important; } }
js操纵
(zepto / jQuery)(750px设计方案图的1rem = 100px) function setFont() { let window_width = window.innerWidth; let font_size = parseFloat(window_width / 3.75); $('html').css('font-size', font_size); } $(window).on('resize', function () { setFont(); });
总结
以上所述是网编给大伙儿详细介绍的CSS3中新闻媒体查寻融合rem合理布局兼容手机上显示屏,期待对大伙儿有一定的协助,假如大伙儿有任何疑惑欢迎给我留言,网编会立即回应大伙儿的!
Copyright © 2002-2020 网页设计_移动端网页设计_大一网页设计作业成品_网页编辑软件_网页在线编辑 版权所有 (网站地图) 粤ICP备10235580号