使用CSS浏览器重置代码的目的是什么? [英] What's the purpose of using CSS browser reset code?

查看:104
本文介绍了使用CSS浏览器重置代码的目的是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是否为浏览器重置的有效CSS?它有什么作用?我已经使用了很长时间。

Is this valid CSS for browser reset? What does it do? I have been using this for a long time.

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 /

This is a version of Eric Meyer's CSS reset. You can read about it here: 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/

And here's a history of why and how it came to life: http://sixrevisions.com/css/the-history-of-css-resets/

这篇关于使用CSS浏览器重置代码的目的是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆