src/cm/media/js/lib/yui/yui_3.10.3/docs/cssbase/cssbase-context.html
author Yves-Marie Haussonne <ymh.work+github@gmail.com>
Fri, 09 May 2014 18:35:26 +0200
changeset 656 a84519031134
parent 525 89ef5ed3c48b
permissions -rw-r--r--
add link to "privacy policy" in the header test

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Example: Contextual Example</title>
    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans:400,700,400italic,700italic">
    <link rel="stylesheet" href="../../build/cssgrids/cssgrids-min.css">
    <link rel="stylesheet" href="../assets/css/main.css">
    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
    <link rel="shortcut icon" type="image/png" href="../assets/favicon.png">
    <script src="../../build/yui/yui-min.js"></script>
    
</head>
<body>
<!--
<a href="https://github.com/yui/yui3"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"></a>
-->
<div id="doc">
    <div id="hd">
        <h1><img src="http://yuilibrary.com/img/yui-logo.png"></h1>
    </div>
    

            <h1>Example: Contextual Example</h1>
    <div class="yui3-g">
        <div class="yui3-u-3-4">
            <div id="main">
                <div class="content"><div class="intro">
    <p>CSS Base can be used contextually by appyling CSS Base to specific regions of the page.</p>
</div>

<div class="example newwindow">
    <a href="cssbase-context-example.html" target="_blank" class="button">
        View Example in New Window
    </a>
</div>

    <h2>Contextual Usage</h2>
    <p>When CSS Base is included in a page it applies rules to all HTML elements via type selectors like this: <code>h1 {margin-bottom:1em;}</code>. An alternate version, <code>cssbase-context.css</code>, uses only descendent selectors like this: <code>.yui3-cssbase-context h1 {margin-bottom:1em;}</code>. This means you can put that class value on a node in your document to choose which region(s) of your page CSS Base will be applied to.</p>

<pre class="code prettyprint">&lt;div class=&quot;yui3-cssbase&quot;&gt;
    &lt;p&gt;Everything within this container will have CSS Base applied.&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;</pre>


<h3>Note:</h3>
<p>Because CSS examples are susceptible to other CSS on the page, this example is only available in a new window at the above link.</p>
</div>
            </div>
        </div>

        <div class="yui3-u-1-4">
            <div class="sidebar">
                

                
                    <div class="sidebox">
                        <div class="hd">
                            <h2 class="no-toc">Examples</h2>
                        </div>

                        <div class="bd">
                            <ul class="examples">
                                
                                    
                                        <li data-description="When CSS Base is included in a page it provides consistent and basic cross-browser styling for HTML elements.">
                                            <a href="cssbase-basic.html">Global (Page-Level) Example</a>
                                        </li>
                                    
                                
                                    
                                        <li data-description="CSS Base applied to a portion of a page based on the location of a class value.">
                                            <a href="cssbase-context.html">Contextual Example</a>
                                        </li>
                                    
                                
                                    
                                
                                    
                                
                            </ul>
                        </div>
                    </div>
                

                
                    <div class="sidebox">
                        <div class="hd">
                            <h2 class="no-toc">Examples That Use This Component</h2>
                        </div>

                        <div class="bd">
                            <ul class="examples">
                                
                                    
                                
                                    
                                
                                    
                                        <li data-description="When CSS Reset is included in a page, it removes the browser-provided styling for HTML elements.">
                                            <a href="../cssreset/cssreset-basic.html">Global (Page-Level) Example</a>
                                        </li>
                                    
                                
                                    
                                        <li data-description="CSS Reset applied to a portion of a page based on the location of a class value.">
                                            <a href="../cssreset/cssreset-context.html">Contextual Example</a>
                                        </li>
                                    
                                
                            </ul>
                        </div>
                    </div>
                
            </div>
        </div>
    </div>
</div>

<script src="../assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>

<script>
YUI.Env.Tests = {
    examples: [],
    project: '../assets',
    assets: '../assets/cssbase',
    name: 'cssbase-context',
    title: 'Contextual Example',
    newWindow: 'true',
    auto:  false 
};
YUI.Env.Tests.examples.push('cssbase-basic');
YUI.Env.Tests.examples.push('cssbase-context');
YUI.Env.Tests.examples.push('cssreset-basic');
YUI.Env.Tests.examples.push('cssreset-context');

</script>
<script src="../assets/yui/test-runner.js"></script>



</body>
</html>