Normalize.css 和重置 CSS 有什么区别? [英] What is the difference between Normalize.css and Reset CSS?

查看:21
本文介绍了Normalize.css 和重置 CSS 有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I know what CSS Reset is, but recently I heard about this new thing called Normalize.css

Normalize.css重置 CSS?

规范化 CSS 和重置 CSS 有什么区别?

What is the difference between normalizing CSS and resetting CSS?

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

Is it just a new buzz word for the CSS Reset?

推荐答案

我致力于 normalize.css.

I work on normalize.css.

主要区别是:

  1. Normalize.css 保留有用的默认值,而不是取消样式"所有内容. 例如,像 supsub 这样的元素只是在包含 normalize.css 之后工作"(并且实际上变得更健壮),而在包含 reset.css 之后它们在视觉上与普通文本没有区别.因此, normalize.css 不会将视觉起点(同质性)强加给您.这可能不是每个人的口味.最好的办法是对两者进行试验,看看哪种凝胶符合您的喜好.

  1. 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 修正了一些在 reset.css 范围之外的常见错误.它的范围比 reset.css 更广,并且还为常见问题提供了错误修复,例如:HTML5 元素的显示设置,缺少表单元素对 font 的继承,纠正 prefont-size 渲染,IE9 中的 SVG 溢出,以及iOS 中的 button 样式错误.

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 不会让您的开发工具混乱. 使用 reset.css 时的一个常见问题是浏览器 CSS 调试工具中显示的大型继承链.由于有针对性的样式,这不是 normalize.css 的问题.

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 更加模块化.该项目被分解为相对独立的部分,如果您知道它们会删除部分(如表单规范化),您可以轻松地删除它们您的网站永远不需要.

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 有更好的文档. normalize.css 代码在GitHub 维基.这意味着您可以找出每行代码在做什么,为什么包含它,浏览器之间有什么区别,并且更容易地运行您自己的测试.该项目旨在帮助人们了解浏览器默认如何呈现元素,并使他们更容易参与提交改进.

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.

我在关于 normalize.css

这篇关于Normalize.css 和重置 CSS 有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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