homepage Welcome to WebmasterWorld Guest from 54.211.180.175
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

    
Difference between YUI and basic CSS reset
And which is best to apply on average
CSS_Kidd




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

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.

 

Fotiman




msg:4115030
 1:35 pm on Apr 13, 2010 (gmt 0)

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.

CSS_Kidd




msg:4115046
 1:51 pm on Apr 13, 2010 (gmt 0)

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:

input,button,textarea,select{
*font-size:100%;
}

Fotiman




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

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.
[meyerweb.com...]
[meyerweb.com...]
[meyerweb.com...]
[meyerweb.com...]
[meyerweb.com...]
[meyerweb.com...]

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. :)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved