css - 使用 CSS 浏览器重置代码的目的是什么?

标签 css

这是用于浏览器重置的有效 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/

相关文章:

html - 如何在多个 div 中重用 angularjs 条形图指令

php - html2ps - 如何打印小标签?

css - 如何将表格标题中的排序图像右对齐

html - CSS 在 IE 6 和 7 中水平显示无序列表

css - Chrome 移动设备屏幕模拟器

html - 如何将 flex 与 html 中的列表一起使用?

javascript - 在任一方向平滑滚动文档

javascript - 如何在 d3 js 垂直分组条形图中添加工具提示

javascript - 延迟脚本是否在 DOMContentLoaded 事件之前执行?

jquery - 如何设置选择及其选项元素的样式并添加过渡?