每个浏览器默认的属性不同,像谷歌浏览器不设置的话,默认每个元素是有外边距margin的,有的浏览器列表还会带上序号,有的浏览器就没有。
所以为了让所有浏览器都一致,在写CSS开始前,我们都需要用CSS把全部标签属性重置一次,我的站长站自用的重置CSS代码分享给大家。
*{padding:0px;margin:0px;box-sizing:border-box;}
h1,h2,h3,h4,h5{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
2021-09-24 85css是前端开发中的样式语言,学好CSS可以帮助开发出漂亮的模板,css专题为您整理本站所有css相关信息,包含css模板下载,css使用教程分享和css示例代码....
- css3海浪波浪动态效果代码 [2021-10-25]
- css样式内加载其他CSS文件方法 [2021-09-27]
- HTML5+CSS3前端开发基础入门视频教程 [2021-09-16]
- HTML+CSS物业后台管理系统模板 [2021-08-15]
- HTML5/CSS3响应式Synthetica团队介绍模板 [2021-04-06]

