This looks nice - will have to try it out later to see how it behaves. It's good to see a detailed breakdown and justification for each of the rules instead of a blanket styling dumped in with no thought.
I'm working on a project at the moment that has div {float:left} in the reset and it makes me weep.
Please don't use this file. Use it for inspiration and take the parts that make sense for your website, but don't just copy the entire file without examining it closely.
For example, this file disables the webkit text size adjustment on the iPhone. Text size adjustment is what makes most websites readable on the iPhone without excessive zooming / scrolling. You should disable it only if you are making a mobile optimized version of your website and the automatic text size adjustment actually causes problems.
/*
* 1. Corrects text resizing oddly in IE 6/7 when body `font-size` is set using
* `em` units.
* 2. Prevents iOS text size adjust after orientation change, without disabling
* user zoom.
*/
html {
font-size: 100%; /* 1 */
-webkit-text-size-adjust: 100%; /* 2 */
-ms-text-size-adjust: 100%; /* 2 */
}
Your statement would be true if it was setting -webkit-text-size-adjust:none, but 100% does as the comment says and only prevents resizing when changing orientations.
I'm torn on this. There's a lot of code in here that most sites will never need. I hate bloat, especially on the frontend which is responsible for 90% of site speed. On the other hand, using this as your starting point for a new project will probably save you a fair amount of time. Perhaps start with this then rip out the stuff you don't end up using?
> There's a lot of code in here that most sites will never need. [...] Perhaps start with this then rip out the stuff you don't end up using?
It’s designed to be used as a reference. i.e. if my website uses an <em> element, I'll want to make sure I’ve ripped out those styles from normalize.css and placed them in my own CSS file. They will serve as a starting point. You should not be including the normalize.css directly on a page.
Personally, I prefer this kind of approach as opposed to a style reset. Style resets lose all visual information that originally came with the element. If a client wanted to use an <h4> but I didn’t style it in the first place it ends up looking like regular body text with no additional padding or margins. A normalise approach forgives me for my lack of forethought allowing an almost right for 90% of cases.
C'mon, it's CSS, you can easily remove that line with the textarea declaration and you're done leaving it to whatever is used by a browser. Or make it all serif, it's that easy.
Looks pretty good. Need to back-port a couple of my projects to use a reset like this because the slight variations between Chrome/Firefox/IE are starting to get on my nerves. Now just have to find some time for such a low-priority backlog item.
Uhm, the largest "html5 boilerplate" actually uses normalize. Normalize.css straightens the subtle differences in the default stylesheets for the different browsers. It is css only, not really a template. It is like giving different car manufacturers specs and designs to build a car. They all build the same car but slightly different. Normalize tries to make them look all exact the same (they still behave different though)
On the one hand, true, but on the other, it'll let them get started developing their actual site, rather than dig through obscure browser differences - thus making work more fun and easier to learn. At least in my experience.