Skip to content

Commit b13ff1e

Browse files
committed
feat: combining selector
1 parent 51282cd commit b13ff1e

File tree

2 files changed

+28
-10
lines changed

2 files changed

+28
-10
lines changed

starter/03-CSS-Fundamentals/index.html

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ <h2>The Basic Language of the Web: HTML</h2>
3939
width="50"
4040
/>
4141

42-
<p>Posted by <strong>Laura Jones</strong> on Monday, June 21st 2027</p>
42+
<p id="author">
43+
Posted by <strong>Laura Jones</strong> on Monday, June 21st 2027
44+
</p>
4345

4446
<img
4547
src="img/post-img.jpg"
@@ -114,7 +116,7 @@ <h3>Why should you learn HTML?</h3>
114116
<aside>
115117
<h4>Related posts</h4>
116118

117-
<ul>
119+
<ul class="related">
118120
<li>
119121
<img
120122
src="img/related-1.jpg"
@@ -123,12 +125,12 @@ <h4>Related posts</h4>
123125
width="75"
124126
/>
125127
<a href="#">How to Learn Web Development</a>
126-
<p>By Jonas Schmedtmann</p>
128+
<p class="related-author">By Jonas Schmedtmann</p>
127129
</li>
128130
<li>
129131
<img src="img/related-2.jpg" alt="Lightning" width="75" heigth="75" />
130132
<a href="#">The Unknown Powers of CSS</a>
131-
<p>By Jim Dillon</p>
133+
<p class="related-author">By Jim Dillon</p>
132134
</li>
133135
<li>
134136
<img
@@ -138,13 +140,13 @@ <h4>Related posts</h4>
138140
height="75"
139141
/>
140142
<a href="#">Why JavaScript is Awesome</a>
141-
<p>By Matilda</p>
143+
<p class="related-author">By Matilda</p>
142144
</li>
143145
</ul>
144146
</aside>
145147

146148
<footer>
147-
<p>Copyright &copy; 2027 by The Code Magazine.</p>
149+
<p id="copyright">Copyright &copy; 2027 by The Code Magazine.</p>
148150
</footer>
149151
</body>
150152
</html>

starter/03-CSS-Fundamentals/style.css

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,27 @@ li {
3737
}
3838

3939
/* * Descendent Selecter */
40-
footer p {
40+
/* footer p {
4141
font-size: 16px;
42-
}
42+
} */
43+
/* article header p {
44+
font-style: italic;
45+
} */
4346

44-
/* * Nested Descendent Selecter */
45-
article header p {
47+
/* * ID Selector: (Don't use this) */
48+
#author {
4649
font-style: italic;
50+
font-size: 18px;
51+
}
52+
#copyright {
53+
font-size: 16px;
54+
}
55+
56+
/* * Class Selector: (Use this instead) */
57+
.related-author {
58+
font-size: 18px;
59+
font-weight: bold;
60+
}
61+
.related {
62+
list-style: none;
4763
}

0 commit comments

Comments
 (0)