每个浏览器默认的属性不同,像谷歌浏览器不设置的话,默认每个元素是有外边距margin的,有的浏览器列表还会带上序号,有的浏览器就没有。
所以为了让所有浏览器都一致,在写CSS开始前,我们都需要用CSS把全部标签属性重置一次,我的站长站自用的重置CSS代码分享给大家。
1 2 3 4 5 6 7 8 9 10 11 12 | *{ padding : 0px ; margin : 0px ;box-sizing:border-box;} h 1 ,h 2 ,h 3 ,h 4 ,h 5 { font-weight : normal ;} ul,ol,dl,li{ list-style : none ;} input,textarea,select{ font-family :inherit; font-size :inherit; font-weight :inherit;* font-size : 100% ;} input{ outline : none ; background : none ;}input::-ms-clear{ display : none ;}input::-ms-reveal{ display : none ;}input[type=text]::-ms-clear{ display : none ;} textarea{resize: none ;} table{ font-size :inherit; border-collapse : collapse ; border-spacing : 0 ;} img,input,button{ border : 0px ;}:focus{ outline : 0 ;} a:link,a:visited{ text-decoration : none ;} ::-webkit-scrollbar{ width : 5px ; height : 5px ;} ::-webkit-scrollbar-thumb{ min-height : 28px ; padding-top : 100 ; background-color :rgba( 0 , 0 , 0 , 0.2 ); -webkit-background- clip :padding-box;background- clip :padding-box;border-radius: 5px ;-webkit-box-shadow: inset 1px 1px 0 rgba( 0 , 0 , 0 , 0.1 ), inset 0 -1px 0 rgba( 0 , 0 , 0 , 0.07 );} |
这段代码我的站长站用了很多次了,没有任何问题。
上一篇:CSS+JS简单的底部浮动搜索框效果代码 下一篇:常用的CSSHack浏览器兼容写法 栏目分类帝国CMS教程
织梦cms教程
discuz教程
ecshop教程
phpcms教程
wordpress教程
苹果cms教程
php教程
数据库教程
微信小程序教程
python教程
css教程
js教程
视频教程
电子书
热门推荐- 01 IE不显示加载iconfont阿里巴巴图标的解决方法 377热度
- 02 CSS文字超出省略号显示 318热度
- 03 分享IE6 PNG 透明的几种方法 244热度
- 04 为什么bootstrap国内很少人使用 241热度
- 05 CSS定位控制上下左右坐标教程 210热度