您的位置:首页 > Web前端 > CSS

css兼容性写法

2016-04-07 11:43 453 查看
清除浮动

.clearfloat:after{
display:block;
clear:both;
content:".";
visibility:hidden;
height:0;
}
.clearfloat{
zoom:1;
}

漂

.pull-left{
float: left;
display: inline;
}
.pull-right{
float:right;
display: inline;
}

透明度兼容性
/* older safari/Chrome browsers */
-webkit-opacity: 0.2;
/* Netscape and Older than Firefox 0.9 */
-moz-opacity: 0.2;
/* Safari 1.x (pre WebKit!) 老式khtml内核的Safari浏览器*/
-khtml-opacity: 0.2;
/* IE9 + etc...modern browsers */
opacity: .2;
/* IE 4-9 */
filter:alpha(opacity=20);
/*This works in IE 8 & 9 too*/
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=20)";
/*IE4-IE9*/
filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=20);

修改input中placeholder默认样式
::-webkit-input-placeholder { color:rgb(135,135,135);font-size:14px;}
::-moz-placeholder { color:rgb(135,135,135);font-size:14px; } /* firefox 19+ */
:-ms-input-placeholder { color:rgb(135,135,135);font-size:14px; } /* ie */
input:-moz-placeholder { color:rgb(135,135,135);font-size:14px; }

/*盒子模型兼容性写法*/
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
-o-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;

/*border-radius兼容性写法*/
-moz-border-radius: 5px; /* Firefox */
-webkit-border-radius: 5px; /* Safari 和 Chrome */
border-radius: 5px; /* Opera 10.5+, 以及使用了IE-CSS3的IE浏览器 */
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: