|
| 1 | +# normalize.css v3 |
| 2 | + |
| 3 | +Normalize.css is a customisable CSS file that makes browsers render all |
| 4 | +elements more consistently and in line with modern standards. |
| 5 | + |
| 6 | +The project relies on researching the differences between default browser |
| 7 | +styles in order to precisely target only the styles that need or benefit from |
| 8 | +normalizing. |
| 9 | + |
| 10 | +[View the test file](http://necolas.github.io/normalize.css/latest/test.html) |
| 11 | + |
| 12 | +## Install |
| 13 | + |
| 14 | +* [npm](http://npmjs.org/): `npm install --save normalize.css` |
| 15 | +* [Component(1)](https://github.com/component/component/): `component install necolas/normalize.css` |
| 16 | +* [Bower](http://bower.io/): `bower install --save normalize.css` |
| 17 | +* [Download](http://necolas.github.io/normalize.css/latest/normalize.css). |
| 18 | + |
| 19 | +No other styles should come before Normalize.css. |
| 20 | + |
| 21 | +It is recommended that you include the `normalize.css` file as untouched |
| 22 | +library code. |
| 23 | + |
| 24 | +## What does it do? |
| 25 | + |
| 26 | +* Preserves useful defaults, unlike many CSS resets. |
| 27 | +* Normalizes styles for a wide range of elements. |
| 28 | +* Corrects bugs and common browser inconsistencies. |
| 29 | +* Improves usability with subtle improvements. |
| 30 | +* Explains what code does using detailed comments. |
| 31 | + |
| 32 | +## Browser support |
| 33 | + |
| 34 | +* Google Chrome (latest) |
| 35 | +* Mozilla Firefox (latest) |
| 36 | +* Mozilla Firefox 4 |
| 37 | +* Opera (latest) |
| 38 | +* Apple Safari 6+ |
| 39 | +* Internet Explorer 8+ |
| 40 | + |
| 41 | +[Normalize.css v1 provides legacy browser |
| 42 | +support](https://github.com/necolas/normalize.css/tree/v1) (IE 6+, Safari 4+), |
| 43 | +but is no longer actively developed. |
| 44 | + |
| 45 | +## Extended details |
| 46 | + |
| 47 | +Additional detail and explanation of the esoteric parts of normalize.css. |
| 48 | + |
| 49 | +#### `pre, code, kbd, samp` |
| 50 | + |
| 51 | +The `font-family: monospace, monospace` hack fixes the inheritance and scaling |
| 52 | +of font-size for preformated text. The duplication of `monospace` is |
| 53 | +intentional. [Source](http://en.wikipedia.org/wiki/User:Davidgothberg/Test59). |
| 54 | + |
| 55 | +#### `sub, sup` |
| 56 | + |
| 57 | +Normally, using `sub` or `sup` affects the line-box height of text in all |
| 58 | +browsers. [Source](http://gist.github.com/413930). |
| 59 | + |
| 60 | +#### `svg:not(:root)` |
| 61 | + |
| 62 | +Adding `overflow: hidden` fixes IE9's SVG rendering. Earlier versions of IE |
| 63 | +don't support SVG, so we can safely use the `:not()` and `:root` selectors that |
| 64 | +modern browsers use in the default UA stylesheets to apply this style. [SVG |
| 65 | +Mailing List discussion](http://lists.w3.org/Archives/Public/public-svg-wg/2008JulSep/0339.html) |
| 66 | + |
| 67 | +#### `input[type="search"]` |
| 68 | + |
| 69 | +The search input is not fully stylable by default. In Chrome and Safari on |
| 70 | +OSX/iOS you can't control `font`, `padding`, `border`, or `background`. In |
| 71 | +Chrome and Safari on Windows you can't control `border` properly. It will apply |
| 72 | +`border-width` but will only show a border color (which cannot be controlled) |
| 73 | +for the outer 1px of that border. Applying `-webkit-appearance: textfield` |
| 74 | +addresses these issues without removing the benefits of search inputs (e.g. |
| 75 | +showing past searches). |
| 76 | + |
| 77 | +#### `legend` |
| 78 | + |
| 79 | +Adding `border: 0` corrects an IE 8–11 bug where `color` (yes, `color`) is not |
| 80 | +inherited by `legend`. |
| 81 | + |
| 82 | +## Contributing |
| 83 | + |
| 84 | +Please read the CONTRIBUTING.md |
| 85 | + |
| 86 | +## Acknowledgements |
| 87 | + |
| 88 | +Normalize.css is a project by [Nicolas Gallagher](https://github.com/necolas), |
| 89 | +co-created with [Jonathan Neal](https://github.com/jonathantneal). |
0 commit comments