<input type="checkbox">自己自帶默認樣式,須要把它去掉,代碼以下:css
input,button{border:none;outline:none;} input[type="button"] { display:none}//把checkbox的默認樣式去掉
本身能夠在上面加背景圖之類的,通常咱們給它前面加一個label標籤,而後再給label添加樣式,我用的是jquery來給它切換背景圖片,先給它設置了一個默認的背景圖,而後用toggleClassl來切換class,另外一個背景圖寫在css樣式表裏面。html
禁止縮放的meta標籤:<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">。jquery
用媒體查詢設置html的font-size大小:spa
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}}