PHP群:95885625 Hbuilder+MUI群:81989597 站长QQ:634381967
    您现在的位置: 首页 > 开发编程 > HTML5+CSS3教程 > 正文

    移动端如何定义字体font-family

    作者:admin来源:网络浏览:时间:2020-09-30 00:07:50我要评论
    导读:中文字体使用系统默认即可,英文用Helvetica/* 移动端定义字体的代码 */body{font-family:Helvetica;}参考《移动端使用字体的思考》移动...
    中文字体使用系统默认即可,英文用Helvetica
    /* 移动端定义字体的代码 */
    body{font-family:Helvetica;}

    参考《移动端使用字体的思考

    移动端字体单位font-size选择px还是rem

    对于只需要适配手机设备,使用px即可

    对于需要适配各种移动设备,使用rem,例如只需要适配iPhone和iPad等分辨率差别比较挺大的设备

    rem配置参考:

    1. html{font-size:10px
    2. @media screen and (min-width:321px) and (max-width:375px){html{font-size:11px}} 
    3. @media screen and (min-width:376px) and (max-width:414px){html{font-size:12px}} 
    4. @media screen and (min-width:415px) and (max-width:639px){html{font-size:15px}} 
    5. @media screen and (min-width:640px) and (max-width:719px){html{font-size:20px}} 
    6. @media screen and (min-width:720px) and (max-width:749px){html{font-size:22.5px}} 
    7. @media screen and (min-width:750px) and (max-width:799px){html{font-size:23.5px}} 
    8. @media screen and (min-width:800px){html{font-size:25px}} 

     

    转载请注明(B5教程网)原文链接:https://b5.mxunkeji.com/content-142-2873-1.html
    相关热词搜索: