web移动端之ios兼容问题

  网站打包放在ios的app上会自动一瞬间给网站某些标签加上其余标签和属性。致使该标签内容异常android

 

1:ios中点击出现灰色阴影效果,(明明什么效果都没有加)
解决办法:ios

-webkit-tap-highlight-color: transparent;
 
2:xxxx-xx-xx 日期格式在ios中报错
解决办法:改为xxxx/xx/xx格式。例如:web

new Date(this.fullyear + '/' + this.month + '/1').getDay()
 
3:ios将日期识别为电话号码致使的变色问题chrome

缘由:这几个日期被ios自动加了a标签这段代码app

<a dir="ltr" href="tel:2930311" x-apple-data-detectors="true" x-apple-data-detectors-type="telephone" x-apple-data-detectors-result="0">29</a>
 
解决办法:
在样式表中加入字体

*[x-apple-data-detectors] {
border-bottom: 0 !important;
cursor: default !important;
color: inherit !important;
text-decoration: none !important;

参考连接:
点击查看ios将电话号码设置为蓝色的解决办法网站

4:去掉ios中input框有默认阴影框
解决办法:this

input {
outline-color: invert;
outline-style: none;
outline-width: 0px;
border: none;
border-style: none;
text-shadow: none;
-webkit-appearance: none;
-webkit-user-select: text;
outline-color: transparent;
box-shadow: none;
}
 
5:ios中字体会显示加粗效果,可是在android上显示ok
解决办法:进行抗锯齿渲染。
这个属性能够使页面上的字体抗锯齿,使用后字体看起来会更清晰。spa

-webkit-font-smoothing: antialiased; /*chrome、safari*/
-moz-osx-font-smoothing: grayscale;/*firefox*/
 
解释:firefox

(1)Webkit在本身的引擎中支持了这一效果。-webkit-font-smoothing它有三个属性值:none ------ 对低像素的文本比较好subpixel-antialiased------默认值antialiased ------抗锯齿很好 例子:body{-webkit-font-smoothing: antialiased;}  (2)Gecko也推出了本身的抗锯齿效果的非标定义。-moz-osx-font-smoothing: inherit | grayscale;这个属性也是更清晰的做用。例子:.icon {-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;}