views:

281

answers:

4

Which HTML5 reset CSS do you use and why? Is there one that you've found to cover more cases?

I've started using HTML5 Doctor's: http://html5doctor.com/html-5-reset-stylesheet/ It seems to work, but I'm wondering if there is something better out there.

A: 

In addition to suggestion from stackoverflow users, I figured I post a link to the same question on doctype.com:

JohnB
+2  A: 

Here's two you might try out:

http://html5reset.org/

http://html5boilerplate.com

triptych
A: 
* {
    margin: 0;
    padding: 0;
}

simple yet entirely effective. perhaps throw in a:

body {
    font-size: small;
}

for good measure.

kaikai
Zapping the default margin and padding on form controls can have unwelcome effects and named font-size keywords don't have entirely consistent behavior across browsers. This is overly simplistic. It also fails to set styles for elements introduced in HTML 5, so they remain `display: inline`.
David Dorward
I disagree. Margin and padding are the only unpredictable properties. The font-size property uses a named keyword to specifically target browsers who read those, which makes the YUI font scales effective across every major browser (http://developer.yahoo.com/yui/examples/fonts/fonts-size_source.html). I would also never want to impose upon the normal flow of elements and so I would leave those HTML 5 elements alone, only changing their display type or positioning as needed.I realize my choice is unpopular, but it is far more elegant than other solutions and it works.
kaikai
+1  A: 

The reset.css used by Blueprint CSS framework works well and includes HTML5 elements. It gets included in their screen.css file.

Blueprint is a useful resource for rapid prototyping of new sites, and their source code is well organized and worth learning from.

calvinf