微信公众号页面遇到的坑

<input type="checkbox">本身自带默认样式,需要把它去掉,代码如下:

input,button{border:none;outline:none;}
input[type="button"] {
display:none}//把checkbox的默认样式去掉

自己可以在上面加背景图之类的,一般我们给它前面加一个label标签,然后再给label添加样式,我用的是jquery来给它切换背景图片,先给它设置了一个默认的背景图,然后用toggleClassl来切换class,另一个背景图写在css样式表里面。

禁止缩放的meta标签:<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">。

用媒体查询设置html的font-size大小:

html{font-size:62.5%;}
body{font-size:1rem;font-family:"冬青黑体简体";}
@media screen and (min-800px){html{font-size:25px}}
@media screen and (min-750px) and (max-799px){html{font-size:23.5px}}
@media screen and (min-720px) and (max-749px){html{font-size:22.5px}}
@media screen and (min-640px) and (max-719px){html{font-size:20px}}
@media screen and (min-415px) and (max-639px){html{font-size:15px}}
@media screen and (min-376px) and (max-414px){html{font-size:12px}}
@media screen and (min-321px) and (max-375px){html{font-size:11px}}
@media screen and (max-320px) {html{font-size: 9px}}
原文地址:https://www.cnblogs.com/daikefeng/p/6971807.html