移动端网页大小自适应方案

 <!--页面宽度= 屏幕宽度,最大和最小伸缩比都是1,不允许用户拉缩-->
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
@media screen and (min-width:321px) and (max-width:375px){html{font-size:14px}}
@media screen and (min-width:376px) and (max-width:414px){html{font-size:16px}}
@media screen and (min-width:415px) and (max-width:639px){html{font-size:16px}}
@media screen and (min-width:640px) and (max-width:719px){html{font-size:16px}}
@media screen and (min-width:720px){html{font-size:16px}}
@media screen and (min-width:750px) and (max-width:799px){html{font-size:23.5px}}
@media screen and (min-width:800px)and (max-width:1199px){html{font-size:25px}body{max-width:800px;margin:0 auto;}}
@media screen and (min-width:1200px){html{font-size:30px}body{max-width:800px;margin:0 auto;}}

 

posted on 2017-01-20 16:17  晓小东  阅读(57)  评论(0)    收藏  举报

导航