微信公众号页面遇到的坑
<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-width:800px){html{font-size:25px}} @media screen and (min-width:750px) and (max-width:799px){html{font-size:23.5px}} @media screen and (min-width:720px) and (max-width:749px){html{font-size:22.5px}} @media screen and (min-width:640px) and (max-width:719px){html{font-size:20px}} @media screen and (min-width:415px) and (max-width:639px){html{font-size:15px}} @media screen and (min-width:376px) and (max-width:414px){html{font-size:12px}} @media screen and (min-width:321px) and (max-width:375px){html{font-size:11px}} @media screen and (max-width:320px) {html{font-size: 9px}}