移动端常用设置

和自甴很熟 提交于 2019-12-02 12:51:35

移动端常用设置

1、重置样式
*,
::before,
::after {
    margin: 0;
    padding: 0;
    /* 针对移动端 */
    box-sizing: border-box;
    -webkit-box-sizing: border-box; /* 低版本主流浏览器兼容 */
    -webkit-tap-highlight-color: transparent;/* 点击高亮效果清除 */
}

2、设置字体
在PC端常用字体是Microsoft Yahei,而在移动端常用的是sans-serif;
如:font-family: 'Microsoft Yahei','sans-serif';

3、链接
a {
    text-decoration: none; /* 去掉下划线 */
    color: #333; /* 灰色 */
}
4、input,textarea的边框
input,textarea {
    outline: none;
    border: none;
    resize: none; 
    /* 清除移动端输入框的样式 */
    -webkit-appearance: none;
}
5、表单
ul,ol {
    list-style: none;
}

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!