YUI 3: 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 complement CSS Reset by applying a style foundation for common HTML elements that is consistent for A-grade browsers.
More Information
- Examples: CSS Reset in action.
- Download: CSS Reset as part of the full YUI Library.
- Free Hosting on our fast edge servers with combo-loading.
- License: BSD.
Getting Started
Include Dependencies
To use CSS Reset, include the following source file in your web page:
<!-- Source File --> <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/3.0.0?>/build/cssreset/reset-min.css">
<!-- Source File --> <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/3.0.0?>/build/cssreset/reset-min.css">
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:
<!-- Source File --> <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/3.0.0/build/cssreset/reset-context-min.css">
<!-- Source File --> <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/3.0.0/build/cssreset/reset-context-min.css">
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:
<div> <div id="left-column" class="yui-reset"><h1>Lorem Ipsum</h1></div> <div id="right-column"><h1>Lorem Ipsum</h1></div> </div>
<div> <div id="left-column" class="yui-reset"><h1>Lorem Ipsum</h1></div> <div id="right-column"><h1>Lorem Ipsum</h1></div> </div>
Here is an example page where only a portion of the page is impacted because it is being used contextually.
Support & Community
Forums & Blog
YUI 3 discussion forums are hosted on YUILibrary.com.
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.

