ios、安卓前端兼容性1

2.input框聚焦,ios出现outline或者阴影,安卓显示正常

  • 解决方法
input:focus{outline:none}
input:{-webkit-appearance: none;} 

3.关于flex布局

  • 解决方法
    flex布局对于低版本的安卓,不支持flex-wrap:wrap属性,但是ios系统支持换行属性,这个时候如何解决呢?当然是不使用换行啦。
    如果你的布局必须要用到换行,那就在外层包裹一个大的div,然后设置几个小div,每个小div的布局都是flex(但是不换行哦);(希望你能理解我的意思,如果不理解,可以在下方留言,我会实时做出解答)

4.ios系统,会将数字当成电话号码,导致变色

  • 解决方法
<meta name="format-detection" content="telephone=no"> <meta http-equiv="x-rim-auto-match" content="none"> 

将上面的代码加入到<head>标签中

5.禁止安卓识别email

  • 解决方法
<meta content="email=no" name="format-detection" /> 

6.input 的placeholder属性会使文本位置偏上

  • 解决方法
line-height: (和input框的高度一样高)---pc端解决方法
line-height:normal ---移动端解决方法

7.input type=number之后,pc端出现上下箭头

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none !important; margin: 0; }



作者:一个写前端的姑娘

猜你喜欢

转载自www.cnblogs.com/AlbertP/p/10839634.html