Welcome to WebmasterWorld Guest from

Forum Moderators: not2easy

Message Too Old, No Replies

Difference between YUI and basic CSS reset

And which is best to apply on average

1:19 pm on Apr 13, 2010 (gmt 0)

5+ Year Member

I guess this is a preference question more than anything: But over all what is the "Big" difference (other than just copying and pasting) between Yahoo's YUI Reset CSS [developer.yahoo.com] and the basic one I have used for years:

* (or other tags) {
reset values

In all honesty, I never knew yahoo had such a thing until limbo posted it in a response here:[webmasterworld.com ].

Maybe it is me but it seems a bit redundant to someone like me who has been doing this for years. I also have had personal experiences with Google's (I know, not Yahoo) Map API library not always being available, due to lag or down time. Thus causing my maps not to work all the time on my sites. So who's to say the same thing wouldn't happen with this YUI shortcut?

Any other thoughts

Update: Yahoo's YUI reset CSS doesn't completely validate either.
1:35 pm on Apr 13, 2010 (gmt 0)

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

Using the universal selector to set margin and padding to 0 will affect all elements (including form elements like text inputs and textareas). In some browsers, the styles on those form elements will be ignored while others might have the look of their inputs altered. Basically, setting the styles on form elements can be problematic and inconsistent. Also, using the universal selector is not really efficient. The browser will need to apply the style rules to every element in the document.

As for not being able to connect to the YUI file, if that is a concern for you, you could always get a copy of library and store the file locally, so it's at the same server as the rest of your files. But note, the YUI hosted files are stored in the cloud, and may even download faster or be closer to your end users than files served from your own server.

EDIT: Note, the YUI reset also seems to set margin/padding to 0 on input and textarea elements, so I guess that's not really a valid argument.
1:51 pm on Apr 13, 2010 (gmt 0)

5+ Year Member

So Really what you are saying is that I should continue to reset the way I always reset with my own CSS file set locally on my sites server.

Just to clarify, I wasn't just referring to the universal selector. I also meant any other resets for specific tags (as stated in parentheses). I apply many different resets depending on my needs. Sorry if I wrote that in an unclear way.

Also after I wrote this post I went back to compare Yahoo's reset with variations of mine. The only thing I have never applied that Yahoo does is this:

2:41 pm on Apr 13, 2010 (gmt 0)

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

I'm saying you can continue to reset with your CSS file locally (if you choose), or you could store a local copy of the Yahoo reset.css file (vs. accessing the file from the Yahoo servers). There probably is very little difference. You might also check out what Eric Meyer came up with for his own reset styles. It was similar to the Yahoo version, but he wrote:

except that I donít think it goes far enough in some areas, and a little too far in others.

He has talked about (and modified) his version several times.

Personally, I'm not really a fan of the universal selector approach, as I feel it's inefficient, and typically you would only want to reset margin and padding with that selector. But your mileage may vary. :)

Featured Threads

Hot Threads This Week

Hot Threads This Month