Skip to content

Commit e1af53a

Browse files
committed
ch. 25 combining selectors
1 parent 1cf1fe9 commit e1af53a

File tree

1 file changed

+38
-1
lines changed

1 file changed

+38
-1
lines changed

starter/03-CSS-Fundamentals/notes/index.html

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ <h2 class="chapter-heading">Ch. 26 Class and ID Selectors</h2>
178178
By adding class and id attributes to elements, class and ID selectors
179179
can be supplied for a CSS rule.
180180
</p>
181-
<p>An id attribute value may only be used once.</p>
181+
<p>An ID may only appear once within the html code, whereas a class may appear any number of times.</p>
182182
<p>
183183
It is a standard convention for classes and IDs comprising of multiple
184184
words to be strung together by using dashes.
@@ -187,6 +187,43 @@ <h2 class="chapter-heading">Ch. 26 Class and ID Selectors</h2>
187187
If multiple CSS rules apply to the same element, then technically they
188188
all apply (more later).
189189
</p>
190+
<section class="chapter-sub-section">
191+
<h3 class="chapter-sub-section-heading">Examples</h3>
192+
<article class="chapter-sub-section">
193+
<h4 class="chapter-sub-section-heading">ID Selector</h4>
194+
<div class="chapter-sub-section">
195+
<h5 class="chapter-sub-section-heading">style.css</h5>
196+
<code>
197+
<pre>#author {
198+
...
199+
}</pre>
200+
</code>
201+
</div>
202+
<div class="chapter-sub-section">
203+
<h5 class="chapter-sub-section-heading">index.html</h5>
204+
<code><pre>&lt;p id="author"&gt;...&lt;/p&gt;</pre></code>
205+
</div>
206+
</article>
207+
<article class="chapter-sub-section">
208+
<h4 class="chapter-sub-section-heading">Class Selector</h4>
209+
<div class="chapter-sub-section">
210+
<h5 class="chapter-sub-section-heading">style.css</h5>
211+
<code>
212+
<pre>.author {
213+
...
214+
}</pre>
215+
</code>
216+
</div>
217+
<div class="chapter-sub-section">
218+
<h5 class="chapter-sub-section-heading">index.html</h5>
219+
<code>
220+
<pre>&lt;p class="author"&gt;...&lt;/p&gt;
221+
&lt;p class="author"&gt;...&lt;/p&gt;
222+
</pre>
223+
</code>
224+
</div>
225+
</article>
226+
</section>
190227
</section>
191228
<article class="chapter-sub-section">
192229
<h3 class="chapter-sub-section-heading">Why use classes over IDs?</h3>

0 commit comments

Comments
 (0)