Note: This is the YUI 3.x site. Looking for the YUI 2.x site?

YUI 3: The CSS Reset File

CSS Reset

The foundational CSS Reset removes the inconsistent styling of HTML elements provided by browsers. This creates a dependably flat foundation to built upon. With CSS Reset loaded, write explicit CSS your project needs.

Note: CSS Base can compliment CSS Reset by applying a style foundation for common HTML elements that is consistent for A-grade browsers.

Getting Started

Include Dependencies

To use CSS Reset, include the following source file in your web page:

Global vs. Contextual

YUI's CSS resources apply rules to HTML elements directly (using type selectors). An alternate version of the resource is available that target elements by context only. This contextual -context.css version selects HTML elements only when they descend from the .yui-reset classname.

Here is how to include the contextual version of CSS Reset:

Using CSS Reset

Using CSS Reset Globally

CSS Reset is easy to use. When CSS Reset is loaded it removes the inconsistent styling of HTML elements provided by browsers. Now, just begin writing the CSS rules your project needs without being burdened by what the browser thinks you need.

Here is an example page showing HTML elements once CSS Reset has been included in the page globally.

Using CSS Reset Contextually

If you're using the contextual version, CSS Reset's rules are only applied to nodes that descend from a node with a class value of .yui-reset. In this example, CSS Reset applies to the h1 in the left column, but does not impact the h1 in the right column:

Here is an example page where only a portion of the page is impacted because it is being used contextually.

Support & Community

Forum & Blog

There is a dedicated mailing list for YUI 3. Click the link to visit the list, or use the form below to subscribe:

 

You might also be interested in the general YUI list: ydn-javascript.

In addition, please visit the YUIBlog for updates and articles about the YUI Library written by the library's developers.

Filing Bugs & Feature Requests

The YUI Library's public bug tracking and feature request repositories are located on the YUILibrary.com site. Before filing new feature requests or bug reports, please review our reporting guidelines.

Copyright © 2009 Yahoo! Inc. All rights reserved. Copyright | Privacy Policy | Terms of Use | Job Openings