移动端常用设置
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;
}
来源:https://blog.csdn.net/Liyunhao_haoge/article/details/102761335