css 兼容性问题

html-css07

css 兼容性问题,第1张

1.H5网页touch滑动的时候在苹果手机上出现不流畅的问题

-webkit-overflow-scrolling 用来控制元素在移动设备上是否使用滚动回弹效果.

解决办法:给所有网页添加如下样式

说明:

-webkit-overflow-scrolling: touch当手指从触摸屏上移开,会保持一段时间的滚动

-webkit-overflow-scrolling: auto当手指从触摸屏上移开,滚动会立即停止

2. css 苹果手机按钮默认样式如何去掉

input[type="button"], input[type="submit"], input[type="reset"] {-webkit-appearance: none}

textarea { -webkit-appearance: none}

3. 如果还有圆角的问题,

** 4.苹果手机不支持box-shadow属性**

如果先给input写边框,用 border:1px solid #ccc

5、去除Chrome等浏览器文本框默认发光边框

6.去掉高光样式:

当然这样以来,当文本框载入焦点时,所有浏览器下的文本框的边框都不会有颜色上及样式上的变化了,这样的话,当文本框载入焦点时,边框颜色就会变为橙色,给用户一个反馈。

7、去除IE10+浏览器文本框后面的小叉叉,只需下面一句就ok了

input::-ms-clear {display: none}

8.H5页面写出来,在chrome中出现如下错误,只需添加如下css即可解决

*{touch-action: pan-y}

一般我们都会对css做一些初始化的设置,特别是块级元素padding margin值设为0;

<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title>无标题文档</title>

</head>

<style type="text/css">

input {

 margin: 0

 padding: 0

}

.search input[type="text"] {

 width: 450px

 height: 35px

 padding-left: 8px

 color: #999

 border: 0

 outline: 0

}

.search input[type="submit"] {

 width: 90px

 height: 39px

 background: #ffaa00

 text-align: center

 line-height: 16px

 color: #fff

 font-family: 微软雅黑

 font-weight: 700

 font-size: 16px

 cursor: pointer

 border: none

 margin-left: -8px

}

.form-group {

 float: left

 border: 2px solid #ffaa00

}

</style>

<body>

<div class="search">

  <form method="get" action="#">

    <div class="form-group">

      <input type="text" value="####" onfocus="if(this.value=='####')this.value=''" onblur="if(this.value=='')this.value='####'">

    </div>

    <input type="submit" value="搜 索">

  </form>

</div>

</body>

</html>