我知道什么是CSS重置,但最近我听说了一个叫Normalize.css的新东西

CSS和Reset CSS的区别是什么?

规范化CSS和重置CSS之间的区别是什么?

这只是CSS重置的一个新流行语吗?


当前回答

重设似乎是满足定制设计规范的必要条件,特别是在复杂的非样板型设计项目中。听起来似乎规范化是一种纯web编程的好方法,但通常情况下,网站是web编程和UI/UX设计规则的结合。

其他回答

首先,css是你能使用的最糟糕的库,因为它删除了HTML的标准结构,在将空白填充和其他属性的值赋值为0之后,把你写的所有东西都作为文本显示出来。例如,你会发现<H1>和<H6>是一样的。

另一方面,css使用标准的结构,也修复了几乎所有存在的错误。例如,它解决了表单从一个浏览器显示到另一个浏览器的问题。Normalize通过修改这些特性来解决这个问题,这样你的元素在所有浏览器上的显示都是一样的。

重设似乎是满足定制设计规范的必要条件,特别是在复杂的非样板型设计项目中。听起来似乎规范化是一种纯web编程的好方法,但通常情况下,网站是web编程和UI/UX设计规则的结合。

css主要是一组样式,基于它的作者认为好看的样式,并使它在不同的浏览器中看起来一致。Reset基本上是从元素中剥离样式,这样你就可以更好地控制所有东西的样式。

我两者都用。

一些样式来自Reset,一些来自Normalize.css。例如,在Normalize.css中,有一种样式来确保所有输入元素都有相同的字体,这不会发生(在文本输入和文本区域之间)。Reset没有这样的样式,所以输入有不同的字体,这通常是不需要的。

所以基本上,使用两个CSS文件做一个更好的工作'均衡'一切;)

的问候!

css:每个浏览器都有一些默认的css样式,例如,在段落或标题周围添加填充。如果你添加了normalize样式表,所有这些浏览器默认规则将被重置,因此对于这个实例标签上的0px填充。这里有更多详细信息的链接:https://necolas.github.io/normalize.css/ http://nicolasgallagher.com/about-normalize-css/

我的工作是标准化。css。

主要的区别是:

Normalize.css preserves useful defaults rather than "unstyling" everything. For example, elements like sup or sub "just work" after including normalize.css (and are actually made more robust) whereas they are visually indistinguishable from normal text after including reset.css. So, normalize.css does not impose a visual starting point (homogeny) upon you. This may not be to everyone's taste. The best thing to do is experiment with both and see which gels with your preferences. Normalize.css corrects some common bugs that are out of scope for reset.css. It has a wider scope than reset.css, and also provides bug fixes for common problems like: display settings for HTML5 elements, the lack of font inheritance by form elements, correcting font-size rendering for pre, SVG overflow in IE9, and the button styling bug in iOS. Normalize.css doesn't clutter your dev tools. A common irritation when using reset.css is the large inheritance chain that is displayed in browser CSS debugging tools. This is not such an issue with normalize.css because of the targeted stylings. Normalize.css is more modular. The project is broken down into relatively independent sections, making it easy for you to potentially remove sections (like the form normalizations) if you know they will never be needed by your website. Normalize.css has better documentation. The normalize.css code is documented inline as well as more comprehensively in the GitHub Wiki. This means you can find out what each line of code is doing, why it was included, what the differences are between browsers, and more easily run your own tests. The project aims to help educate people on how browsers render elements by default, and make it easier for them to be involved in submitting improvements.

我在一篇关于normalization .css的文章中对此进行了更详细的描述