码迷,mamicode.com
首页 > Web开发 > 详细

存一些有用的CSS

时间:2015-07-31 14:26:09      阅读:124      评论:0      收藏:0      [点我收藏+]

标签:

reset

body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0}
table{border-collapse:collapse;border-spacing:0}
fieldset,img{border:0}
address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal}
ol,ul{list-style:none}
caption,th{text-align:left}
h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal}
q:before,q:after{content:‘‘}
abbr,acronym{border:0;font-variant:normal}
sup{vertical-align:text-top}
sub{vertical-align:text-bottom}
input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit}
input,textarea,select{*font-size:100%}
*{font-family: "Microsoft Yahei"}
a{text-decoration: none;color: #000}

 

clearfix

.clearfix:after{
    content:".";
    display:block;
    height:0;
    clear:both;
    visibility:hidden
}
.clearfix{
    *+height:1%;
}

 

css hack

hack 写法 IE6(S) IE6(Q) IE7(S) IE7(Q) IE8(S) IE8(Q) IE9(S) IE9(Q) IE10(S) IE10(Q)
* *color Y Y Y Y N Y N Y N Y
+ +color Y Y Y Y N Y N Y N Y
- -color Y Y N N N N N N N N
_ _color Y Y N Y N Y N Y N N
# #color Y Y Y Y N Y N Y N Y
\0 color:red\0 N N N N Y N Y N Y N
\9\0 color:red\9\0 N N N N N N Y N Y N
!important color:blue !important;color:green; N N Y N Y N Y N Y Y
*html *前缀只对IE6生效
*+html *+前缀只对IE7生效
@media screen\9{...}只对IE6/7生效
@media \0screen {body { background: red; }}只对IE8有效
@media \0screen\,screen\9{body { background: blue; }}只对IE6/7/8有效
@media screen\0 {body { background: green; }} 只对IE8/9/10有效
@media screen and (min-width:0\0) {body { background: gray; }} 只对IE9/10有效
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {body { background: orange; }} 只对IE10有效

存一些有用的CSS

标签:

原文地址:http://www.cnblogs.com/rizzle/p/4691833.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!