css清除默认样式_兼容优化版
前端标签默认都会带有样式,简称自带样式,例如body自带8像素边距,这样就比较尴尬了,每次使用都必须要把这么东西格式化一下(清除默认样式),下面代码对ie6以及ie7的默认样式也做了处理, 下面我就给大家整理了日常中默认清除这些样式的代码,一般命名为reset.min.css。
详细代码如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | @charset "utf-8";body,div,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,code,form,fieldset,legend,button,textarea,table,tbody,tfoot,thead,th,td,article,aside,dialog,figure,footer,header,hgroup,menu,nav,section,time,mark,audio,video{ margin:0; padding:0; outline:0; background:transparent; }article,aside,dialog,figure,footer,header,hgroup,nav,section{ display:block; }body,button,input,select,textarea{ font:12px/1.5 微软雅黑,arial,\5b8b\4f53,sans-serif; }h1,h2,h3,h4,h5,h6,button,input,select,textarea{ font-size:100%; }address,cite,dfn,em,var{ font-style:normal; }code,kbd,pre,samp{ font-family:courier new,courier,monospace; }small{ font-size:12px; }ul,ol,li{ list-style:none; }img{ border:none; /*vertical-align: bottom;*/ }a{ text-decoration:none; outline:thin none; }a:hover{ text-decoration:none; }table{ border-collapse:collapse; border-spacing:0; }.clear{ clear:both; }.clearfix:after{ visibility:hidden; display:block; font-size:0; content:" "; clear:both; height:0; } * html .clearfix { zoom: 1; } /* IE6 */ *:first-child+html .clearfix { zoom: 1; } /* IE7 */ html{ -webkit-text-size-adjust: none; } a:focus{ outline:none; } /* a { star:expression(this.onFocus=this.blur()); for Ie; } */ body{ font-family: "microsoft yahei", Regular; } |
7