本文介绍如何使用CSS来移除或覆盖不同浏览器为网页元素添加的默认样式,实现更统一的设计效果。
/* 重置样式 */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd,
q,samp ,small ,strike,strong ,sub,sup ,tt,var ,
b,u,i ,center ,dl ,dt dd ,ol,cite ul li
fieldset form label legend table caption tbody tfoot thead tr th td {
margin:0;
padding:0;
border:0;
outline:0;
font-size:100%;
vertical-align:baseline;
background:transparent
}
body {line-height:1}
ol,ul{list-style:none}
blockquote,q{quotes:none}
blockquote:before, blockquote:after,
q:before, q:after {content:; content:none }
:focus {outline:0 }
ins{text-decoration:none }
del{text-decoration:line-through }
table {
border-collapse:collapse;
border-spacing:0
}
a img {border:none;}
/* 清除浮动 */
.container::after, .clearfix::after{
clear:both;
content:;
display:block;
}
.container, .clearfix{display:inline-block;}
* html .container,* html .clearfix{height:1%;}
.container, .clearfix{display:block;}