Example: Contextual Example

This example shows a page of HTML elements with CSS Reset and contextual CSS Fonts applied.

Contextual Usage

When CSS Fonts is included in a page it applies rules to all HTML elements via type selectors like this: body {font-size:13px;}. An alternate version, cssfonts-context.css, uses only descendent selectors like this: .yui3-cssfonts-context {font-size:13px;}. 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.

<div class="yui3-cssfonts">
    <p>Everything within this container will have CSS Fonts applied.</p>
</div>

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.

Note:

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