这是用于浏览器重置的有效 CSS 吗?它有什么作用?我已经用了很长时间了。
html,body,div,ul,ol,li,dl,dt,dd,h1,h2,h3,h4,h5,h6,pre,form,p,blockquote,fieldset,input,hr {margin:0; padding:0;}
h1,h2,h3,h4,h5,h6,pre,code,address,caption,cite,code,em,strong,th {font-size:1em; overflow:hidden; font-weight:normal; font-style:normal;}
ul,ol {list-style:none;}
fieldset,img,hr {border:none;}
caption,th {text-align:left;}
table {border-collapse:collapse; border-spacing:0;}
td {vertical-align:top;}
最佳答案
这是 Eric Meyer 的 CSS 重置版本。你可以在这里读到它: http://meyerweb.com/eric/thoughts/2011/01/03/reset-revisited/
The goal of a reset stylesheet is to reduce browser inconsistencies in things like default line heights, margins and font sizes of headings, and so on.
下面是它诞生的原因和方式的历史:http://sixrevisions.com/css/the-history-of-css-resets/
关于css - 使用 CSS 浏览器重置代码的目的是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9370294/