YUI 3.x Home -

YUI Library Examples: CSS Fonts: Contextual Example

CSS Fonts: Contextual Example

When CSS Fonts is included in a page it applies a baseline font treatment to all HTML elements via type selectors like this: h1 {font-size:100%;}. An alternate version, -context.css, uses only descendent selectors like this: .cssfonts-context h1 {font-size:100%;}. This means you can put that class value on a node in your document to choose which region(s) of your page CSS Fonts will be applied to.

In this example, only the middle block is within the context of CSS Fonts. The other two blocks are unaffected by CSS Fonts since their context is not one matched by the descendent selector of the contextual version of CSS Fonts.


Because CSS examples are susceptible to other CSS on the page, this example is only available in a new window at the above link.

Copyright © 2009 Yahoo! Inc. All rights reserved.

Privacy Policy - Terms of Service - Copyright Policy - Job Openings