You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>In order to accomplish nesting, this specification defines a new simple selector called the nesting selector, represented in selectors by the '&' character. All complex selectors in the selector lists of nested rule sets must start with the nesting selector. The nesting selector represents the elements matches by the parent rule set's selector list.
164
164
165
165
<divclass='example'>
166
-
<p>The following two examples produce an equivalent result on all pages:
166
+
<p>The following example using Hierarchies:
167
167
168
168
<pre>
169
169
div {
170
170
& .keyword {color: red;}
171
171
&:hover {background-color: rgb(200, 255, 255);}
172
172
}</pre>
173
173
174
+
<p>...produces the same results as the following CSS:
<p>The following two examples provide an equivalent result on all pages:
183
+
<p>The following example using Hierarchies:
183
184
184
185
<pre>
185
186
div, p {
186
187
& .keyword, & .constant {color: red;}
187
188
}</pre>
188
189
190
+
<p>...produces the same results as the following CSS:
191
+
189
192
<pre>
190
193
div .keyword {color:red;}
191
194
div .constant {color:red;}
@@ -196,7 +199,7 @@ <h2 id="nesting-selector">
196
199
<p>Multiple style rules can be embedded within a style rule. Style rules can be embedded arbitrarily deeply. Embedded style rules and properties can co-exist.</p>
197
200
198
201
<divclass='example'>
199
-
<p>The following two examples are equivalent:</p>
202
+
<p>The following example using Hierarchies:
200
203
201
204
<pre>
202
205
div, p {
@@ -209,6 +212,8 @@ <h2 id="nesting-selector">
209
212
}
210
213
}</pre>
211
214
215
+
<p>...produces the same results as the following CSS:
0 commit comments