|
1 <!DOCTYPE html> |
|
2 <html lang="en"> |
|
3 <head> |
|
4 <meta charset="utf-8"> |
|
5 <title>CSS Base</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 <a href="#toc" class="jump">Jump to Table of Contents</a> |
|
24 |
|
25 |
|
26 <h1>CSS Base</h1> |
|
27 <div class="yui3-g"> |
|
28 <div class="yui3-u-3-4"> |
|
29 <div id="main"> |
|
30 <div class="content"> <div class="intro" class="component"> |
|
31 <p class="deprecated"><em> |
|
32 <strong>Note:</strong> The files "base.css" and "base-context.css" are deprecated, use "cssbase.css" and |
|
33 "cssbase-context.css" instead. |
|
34 </em></p> |
|
35 |
|
36 <p>CSS Base is an optional CSS file that complements YUI's core CSS foundation (<a href="../cssreset/">CSS Reset</a> and <a href="../cssfonts/">CSS Fonts</a>). CSS Base applies a style foundation for HTML elements that is consistent for <a href="http://developer.yahoo.com/yui/articles/gbs">baseline browsers</a>.</p> |
|
37 <p>CSS Base may also be useful as a template for your own base file, or a snippets library for styling HTML elements.</p> |
|
38 |
|
39 </div><!-- /promo --> |
|
40 |
|
41 <h2 id="start">Getting Started</h2> |
|
42 |
|
43 <h3 id="dependencies">Include Dependencies</h3> |
|
44 |
|
45 <p>To use CSS Base, include the following source file in your web page:</p> |
|
46 |
|
47 <pre class="code prettyprint"><link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/3.10.3/build/cssbase/cssbase-min.css"></pre> |
|
48 |
|
49 <h3 id="context">Global vs. Contextual</h3> |
|
50 |
|
51 <p>YUI's CSS resources apply rules to HTML elements directly (using <a href="http://www.w3.org/TR/CSS21/selector.html#type-selectors">type selectors</a>). An alternate version of the resource is available that target elements by context only. This contextual <code>-context.css</code> version selects HTML elements only when they descend from the <code>.yui3-cssbase</code> classname.</p> |
|
52 |
|
53 <p>Here is how to include the contextual version of CSS Base:</p> |
|
54 |
|
55 <pre class="code prettyprint"><link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/3.10.3/build/cssbase-context/cssbase-context-min.css"></pre> |
|
56 |
|
57 <h2 id="using">Using CSS Base</h2> |
|
58 |
|
59 <h3 id="start-in-context">Using CSS Base In Specific Contexts</h3> |
|
60 |
|
61 <p>If you're using the contextual version, CSS Base's rules are only applied to elements that descend from a node with a class value of <code>.yui3-cssbase</code>. The classname can go as high in the DOM tree as desired, including on the <code>HTML</code> element directly.</p> |
|
62 |
|
63 <p>The following code snippet show how you might apply CSS Base to one of two columns:</p> |
|
64 |
|
65 <pre class="code prettyprint"><div> |
|
66 <div id="left-column" class="yui3-cssbase"><h1>Lorem Ipsum</h1></div> |
|
67 <div id="right-column"><h1>Lorem Ipsum</h1></div> |
|
68 </div></pre> |
|
69 |
|
70 |
|
71 </div> |
|
72 </div> |
|
73 </div> |
|
74 |
|
75 <div class="yui3-u-1-4"> |
|
76 <div class="sidebar"> |
|
77 |
|
78 <div id="toc" class="sidebox"> |
|
79 <div class="hd"> |
|
80 <h2 class="no-toc">Table of Contents</h2> |
|
81 </div> |
|
82 |
|
83 <div class="bd"> |
|
84 <ul class="toc"> |
|
85 <li> |
|
86 <a href="#start">Getting Started</a> |
|
87 <ul class="toc"> |
|
88 <li> |
|
89 <a href="#dependencies">Include Dependencies</a> |
|
90 </li> |
|
91 <li> |
|
92 <a href="#context">Global vs. Contextual</a> |
|
93 </li> |
|
94 </ul> |
|
95 </li> |
|
96 <li> |
|
97 <a href="#using">Using CSS Base</a> |
|
98 <ul class="toc"> |
|
99 <li> |
|
100 <a href="#start-in-context">Using CSS Base In Specific Contexts</a> |
|
101 </li> |
|
102 </ul> |
|
103 </li> |
|
104 </ul> |
|
105 </div> |
|
106 </div> |
|
107 |
|
108 |
|
109 |
|
110 <div class="sidebox"> |
|
111 <div class="hd"> |
|
112 <h2 class="no-toc">Examples</h2> |
|
113 </div> |
|
114 |
|
115 <div class="bd"> |
|
116 <ul class="examples"> |
|
117 |
|
118 |
|
119 <li data-description="When CSS Base is included in a page it provides consistent and basic cross-browser styling for HTML elements."> |
|
120 <a href="cssbase-basic.html">Global (Page-Level) Example</a> |
|
121 </li> |
|
122 |
|
123 |
|
124 |
|
125 <li data-description="CSS Base applied to a portion of a page based on the location of a class value."> |
|
126 <a href="cssbase-context.html">Contextual Example</a> |
|
127 </li> |
|
128 |
|
129 |
|
130 |
|
131 |
|
132 |
|
133 |
|
134 </ul> |
|
135 </div> |
|
136 </div> |
|
137 |
|
138 |
|
139 |
|
140 <div class="sidebox"> |
|
141 <div class="hd"> |
|
142 <h2 class="no-toc">Examples That Use This Component</h2> |
|
143 </div> |
|
144 |
|
145 <div class="bd"> |
|
146 <ul class="examples"> |
|
147 |
|
148 |
|
149 |
|
150 |
|
151 |
|
152 |
|
153 <li data-description="When CSS Reset is included in a page, it removes the browser-provided styling for HTML elements."> |
|
154 <a href="../cssreset/cssreset-basic.html">Global (Page-Level) Example</a> |
|
155 </li> |
|
156 |
|
157 |
|
158 |
|
159 <li data-description="CSS Reset applied to a portion of a page based on the location of a class value."> |
|
160 <a href="../cssreset/cssreset-context.html">Contextual Example</a> |
|
161 </li> |
|
162 |
|
163 |
|
164 </ul> |
|
165 </div> |
|
166 </div> |
|
167 |
|
168 </div> |
|
169 </div> |
|
170 </div> |
|
171 </div> |
|
172 |
|
173 <script src="../assets/vendor/prettify/prettify-min.js"></script> |
|
174 <script>prettyPrint();</script> |
|
175 |
|
176 <script> |
|
177 YUI.Env.Tests = { |
|
178 examples: [], |
|
179 project: '../assets', |
|
180 assets: '../assets/cssbase', |
|
181 name: 'cssbase', |
|
182 title: 'CSS Base', |
|
183 newWindow: '', |
|
184 auto: false |
|
185 }; |
|
186 YUI.Env.Tests.examples.push('cssbase-basic'); |
|
187 YUI.Env.Tests.examples.push('cssbase-context'); |
|
188 YUI.Env.Tests.examples.push('cssreset-basic'); |
|
189 YUI.Env.Tests.examples.push('cssreset-context'); |
|
190 |
|
191 </script> |
|
192 <script src="../assets/yui/test-runner.js"></script> |
|
193 |
|
194 |
|
195 |
|
196 </body> |
|
197 </html> |