一般会用normalize.css或者reset.css重置样式

移动端特殊css样式

  • 去除ios 按钮按下的默认高亮效果
    -webkit-tap-highlight-color : none;

  • ios 触摸并按住触摸目标时候,禁止或显示系统默认菜单
    -webkit-touch-callout: none;

  • 文本不能被选择; 但是input textarea在ios不能被聚焦,属性要设置成text
    user-select: none;
    input{
    user-select: text;
    }

  • 去除系统默认appearance的样式,常用于IOS下移除原生样式
    -webkit-appearance: none;

  • input placeholder样式
    ::-webkit-input-placeholder {
    color: #ccc;
    }

兼容性

打包的时候使用插件autoprefixer,会自动加上-webkit等前缀。

相关文章:

  • 2022-12-23
  • 2021-11-17
  • 2021-12-31
  • 2022-12-23
  • 2022-12-23
  • 2021-12-16
  • 2022-12-23
  • 2022-01-03
猜你喜欢
  • 2021-12-20
  • 2022-12-23
  • 2021-12-22
  • 2021-11-22
  • 2021-11-08
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案