网页的元素默认带有一些CSS样式,而且各个浏览器的标准不同,如果不加以控制可能会影响到各个浏览器的显示。想像一下,本来各个浏览器有各自不同的标准,而且兼容性已经很耽误时间了,这样看来,对元素设置统一的显示样式有很大的必要。下面就是我经常用的全局样式,写样式时,不管三七二十一,先把这一段贴上去。
body, div, dl, dt, dd, ul, ol, li, hr, h1, h2, h3, h4, h5, h6, pre, code, form,fieldset, legend, input, textarea, p, blockquote, th, td,
header, nav, aside, menu, figure, article, time, footer{
margin: 0;
padding: 0;
}
body, p, form, ul, li{
list-style: none outside none;
}
body{
min-width:1002px;
font:12px “Podkova”,”微软雅黑”,Arial,Tahoma,Verdana,Helvetica,sans-serif;
color:#666;
}
img{
border:0;
outline:none
}
a{
blr:expression_r(this.onFocus=this.blur());
outline:none;
border:0;
cursor:pointer;
color:#666;
text-decoration:none;
}
a:active {
outline: none;
star:expression(this.onFocus=this.blur());
}
area {
blr:expression_r(this.onFocus=this.blur())
}
button::-moz-focus-inner, input[type=”reset”]::-moz-focus-inner, input[type=”button”]::-moz-focus-inner, input[type=”submit”]::-moz-focus-inner, input[type=”file”] > input[type=”button”]::-moz-focus-inner {
border:none ;
padding:0;
}
input{
border:0;
}
select:focus,
textarea:focus,
input:focus{
outline:none;
}