normalize.css README

The project's README from github.com/necolas/normalize.css. As one markdown file: README.md.

normalize.css

Normalize Logo

A modern alternative to CSS resets

npm license changelog gitter

NPM

npm install --save normalize.css

CDN

See https://yarnpkg.com/en/package/normalize.css

Download

See https://necolas.github.io/normalize.css/latest/normalize.css

What does it do?

Browser support

Extended details and known issues

Additional detail and explanation of the esoteric parts of normalize.css.

pre, code, kbd, samp

The font-family: monospace, monospace hack fixes the inheritance and scaling of font-size for preformatted text. The duplication of monospace is intentional. Source.

sub, sup

Normally, using sub or sup affects the line-box height of text in all browsers. Source.

select

By default, Chrome on OS X and Safari on OS X allow very limited styling of select, unless a border property is set. The default font weight on optgroup elements cannot safely be changed in Chrome on OSX and Safari on OS X.

[type="checkbox"]

It is recommended that you do not style checkbox and radio inputs as Firefox's implementation does not respect box-sizing, padding, or width.

[type="number"]

Certain font size values applied to number inputs cause the cursor style of the decrement button to change from default to text.

[type="search"]

The search input is not fully stylable by default. In Chrome and Safari on OSX/iOS you can't control font, padding, border, or background. In Chrome and Safari on Windows you can't control border properly. It will apply border-width but will only show a border color (which cannot be controlled) for the outer 1px of that border. Applying -webkit-appearance: textfield addresses these issues without removing the benefits of search inputs (e.g. showing past searches).

Contributing

Please read the contribution guidelines in order to make the contribution process easy and effective for everyone involved.

normalize.css (necolas/normalize.css)

Searching Database…

这是什么?normalize.css 是一个样式表,能让 HTML 元素的默认样式在各浏览器中保持一致;README 将它定位为 CSS reset 的一种现代替代方案。
它的做法和经典的 CSS reset 有什么不同?很多 reset 会把几乎所有默认样式都清掉;而这个项目保留了有用的默认样式,修复各类 bug 和常见的浏览器不一致问题,并加入了一些细微的易用性改进。
怎么把它加到我的项目里?从 npm、CDN 或 README 里的下载链接获取样式表,然后像引入其他 CSS 文件一样把它引入你的页面。
有没有一些表单控件不值得去自定义样式?有——复选框和单选按钮就别去自定义样式了,因为 Firefox 会忽略它们上面的 box-sizing、padding 和 width;搜索输入框在不加 -webkit-appearance: textfield 的情况下,也有一部分样式改不了。
它支持哪些浏览器?README 列出的有 Chrome、Edge、Firefox ESR 及更新版本、Internet Explorer 10+、Safari 8+ 和 Opera。
这个文件本身可读吗?还是得去查外部文档才能看懂?它就是写给人看的:README 把“用详细的注释解释代码的作用”列为它的特性之一,所以每一条规范化代码都附有行内的原因说明。
代码块的字体栈里为什么 monospace 出现了两次?这个重复是有意为之的技巧,用来修复 pre、code、kbd 和 samp 这类预格式化文本的 font-size 继承和缩放问题。
下拉框和 optgroup 可以随意改样式吗?不能完全随意——OS X 上的 Chrome 和 Safari 会限制 select 的样式设置,除非设置了 border 属性;而且在这些浏览器里,optgroup 的字体粗细最好不要改动。
Creator
necolas
Size
0.4 MB
Stars
53.5K
Updated
CommitNov 05
Age
15y
Commits · 90 Days