|
您的位置: 首頁 > 網站資訊 > 移動端html5手機網站字體單位font-size選擇px照舊rem |
移動端html5手機網站字體單位font-size選擇px照舊rem發布日期:2017/4/14
移動端html5手機網站字體單位font-size選擇px照舊rem 分為兩種情況: ①對于只需要適配手機設備,使用px就可以了 ②對于需要適配各種移動設備,使用rem,例如只需要適配iPhone和iPad等分辨率差別比較挺大的設備。 rem參考代碼: html {font-size:10px} @media screen and (min-width:480px) and (max-width:639px) { html { font-size: 15px } } @media screen and (min-width:640px) and (max-width:719px) { html { font-size: 20px } } @media screen and (min-width:720px) and (max-width:749px) { html { font-size: 22.5px } } @media screen and (min-width:750px) and (max-width:799px) { html { font-size: 23.5px } } @media screen and (min-width:800px) and (max-width:959px) { html { font-size: 25px } } @media screen and (min-width:960px) and (max-width:1079px) { html { font-size: 30px } } @media screen and (min-width:1080px) { html { font-size: 32px } } |
其他相關文章 |
|
|
|
|||||||||
Copyright 2012-2025 上海蒙狼網絡科技有限公司 aqdzp.cn All Rights Reserved |