2 移动端字体单位 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
- }
- }
来源: http://www.qdfuns.com/article/18224/3d0a0e81e44980a7df1572d29d198c7b.html