|
1 <!DOCTYPE html> |
|
2 <html lang="en"> |
|
3 <head> |
|
4 <meta charset="utf-8"> |
|
5 <title>Example: Contextual Example</title> |
|
6 <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans:400,700,400italic,700italic"> |
|
7 <link rel="stylesheet" href="../../build/cssgrids/cssgrids-min.css"> |
|
8 <link rel="stylesheet" href="../assets/css/main.css"> |
|
9 <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css"> |
|
10 <link rel="shortcut icon" type="image/png" href="../assets/favicon.png"> |
|
11 <script src="../../build/yui/yui-min.js"></script> |
|
12 |
|
13 </head> |
|
14 <body> |
|
15 <!-- |
|
16 <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> |
|
17 --> |
|
18 <div id="doc"> |
|
19 <div id="hd"> |
|
20 <h1><img src="http://yuilibrary.com/img/yui-logo.png"></h1> |
|
21 </div> |
|
22 |
|
23 |
|
24 <h1>Example: Contextual Example</h1> |
|
25 <div class="yui3-g"> |
|
26 <div class="yui3-u-3-4"> |
|
27 <div id="main"> |
|
28 <div class="content"><div class="intro"> |
|
29 <p>CSS Base can be used contextually by appyling CSS Base to specific regions of the page.</p> |
|
30 </div> |
|
31 |
|
32 <div class="example newwindow"> |
|
33 <a href="cssbase-context-example.html" target="_blank" class="button"> |
|
34 View Example in New Window |
|
35 </a> |
|
36 </div> |
|
37 |
|
38 <h2>Contextual Usage</h2> |
|
39 <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> |
|
40 |
|
41 <pre class="code prettyprint"><div class="yui3-cssbase"> |
|
42 <p>Everything within this container will have CSS Base applied.</p> |
|
43 </div></pre> |
|
44 |
|
45 |
|
46 <h3>Note:</h3> |
|
47 <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> |
|
48 </div> |
|
49 </div> |
|
50 </div> |
|
51 |
|
52 <div class="yui3-u-1-4"> |
|
53 <div class="sidebar"> |
|
54 |
|
55 |
|
56 |
|
57 <div class="sidebox"> |
|
58 <div class="hd"> |
|
59 <h2 class="no-toc">Examples</h2> |
|
60 </div> |
|
61 |
|
62 <div class="bd"> |
|
63 <ul class="examples"> |
|
64 |
|
65 |
|
66 <li data-description="When CSS Base is included in a page it provides consistent and basic cross-browser styling for HTML elements."> |
|
67 <a href="cssbase-basic.html">Global (Page-Level) Example</a> |
|
68 </li> |
|
69 |
|
70 |
|
71 |
|
72 <li data-description="CSS Base applied to a portion of a page based on the location of a class value."> |
|
73 <a href="cssbase-context.html">Contextual Example</a> |
|
74 </li> |
|
75 |
|
76 |
|
77 |
|
78 |
|
79 |
|
80 |
|
81 </ul> |
|
82 </div> |
|
83 </div> |
|
84 |
|
85 |
|
86 |
|
87 <div class="sidebox"> |
|
88 <div class="hd"> |
|
89 <h2 class="no-toc">Examples That Use This Component</h2> |
|
90 </div> |
|
91 |
|
92 <div class="bd"> |
|
93 <ul class="examples"> |
|
94 |
|
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 <li data-description="When CSS Reset is included in a page, it removes the browser-provided styling for HTML elements."> |
|
101 <a href="../cssreset/cssreset-basic.html">Global (Page-Level) Example</a> |
|
102 </li> |
|
103 |
|
104 |
|
105 |
|
106 <li data-description="CSS Reset applied to a portion of a page based on the location of a class value."> |
|
107 <a href="../cssreset/cssreset-context.html">Contextual Example</a> |
|
108 </li> |
|
109 |
|
110 |
|
111 </ul> |
|
112 </div> |
|
113 </div> |
|
114 |
|
115 </div> |
|
116 </div> |
|
117 </div> |
|
118 </div> |
|
119 |
|
120 <script src="../assets/vendor/prettify/prettify-min.js"></script> |
|
121 <script>prettyPrint();</script> |
|
122 |
|
123 <script> |
|
124 YUI.Env.Tests = { |
|
125 examples: [], |
|
126 project: '../assets', |
|
127 assets: '../assets/cssbase', |
|
128 name: 'cssbase-context', |
|
129 title: 'Contextual Example', |
|
130 newWindow: 'true', |
|
131 auto: false |
|
132 }; |
|
133 YUI.Env.Tests.examples.push('cssbase-basic'); |
|
134 YUI.Env.Tests.examples.push('cssbase-context'); |
|
135 YUI.Env.Tests.examples.push('cssreset-basic'); |
|
136 YUI.Env.Tests.examples.push('cssreset-context'); |
|
137 |
|
138 </script> |
|
139 <script src="../assets/yui/test-runner.js"></script> |
|
140 |
|
141 |
|
142 |
|
143 </body> |
|
144 </html> |