Friday, December 15th, 2006

YUI: Reset The Browsers CSS

Category: CSS, Yahoo!

YUI has a CSS Reset set of style that aims to normalize the browsers so your CSS can start on an even playing field.

The entire CSS file (which you can see here) is just 30 simple lines of getting explicit.

Dean Edwards wants a <reset /> button :)

Posted by Dion Almaer at 12:55 pm

3.8 rating from 43 votes


Comments feed TrackBack URI

I want a element so that I can build widgets without cascaded CSS rules affecting the layout of my widget.

I raised this on the WHATWG mailing list — you never know your luck. ;-)

Comment by Dean Edwards — December 15, 2006

Bah! That should read: I want a <reset> element.

Comment by Dean Edwards — December 15, 2006

would a simple inherit CSS property do?
#mywidget { inherit: none ; }

or would people just find that confusing and get it mixed up with the inherit value?

Comment by carter — December 15, 2006

I think this can be done in 2 lines of code. Somebody correct me if I’m wrong.

Comment by Charlie Park — December 15, 2006

@carter – one of the suggestions to my proposal on the WHATWG list was very similar:


I don’t really mind how it is achieved but sometimes I *really* want to turn off CSS inheritance.

Comment by Dean Edwards — December 15, 2006

Comment by Dean Edwards — December 15, 2006

You forgot to mention the nicely minimized 1 line version
that’s included in the YUI download.
The big one is just so that we dev’s can see what went into it, eh?

Comment by Alexander S — December 15, 2006

I use this one for a while now and I like it very much,
the version reset-min is a nice one, small but usefull

Comment by Erwin — December 16, 2006

Charlie, your 2 liner doesn’t do the same thing. For example, it breaks i, b and I’m sure other tags that are already cross-browser. The purpose of reset.css is to normalize browser differences, not make everything plain text.

Comment by Jack Slocum — December 16, 2006

Jack: Thanks. That helps clear it up.

Comment by Charlie Park — December 17, 2006

Leave a comment

You must be logged in to post a comment.