Skip to content

Commit 8bea2cf

Browse files
Merge pull request TheOdinProject#190 from Zekumoru/fix_exercise_solution
02-class-id-selectors: Change solution
2 parents b65d8fa + baea35d commit 8bea2cf

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

foundations/02-class-id-selectors/solution/solution.css

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
font-family: Verdana, "DejaVu Sans", sans-serif;
44
}
55

6-
.oddly-cool {
6+
.adjust-font-size {
77
font-size: 24px;
88
}
99

@@ -12,8 +12,16 @@
1212
font-size: 36px;
1313
}
1414

15+
/*
16+
In the id selector 'four' below, we could have also
17+
added a rule to set the font size to 24px.
18+
19+
However, since the elements 'Number 3' and 'Number 4'
20+
in the HTML file share the same font size, we reused
21+
the 'adjust-font-size' class above to help reduce
22+
duplicate code.
23+
*/
1524
#four {
1625
background-color: hsl(120, 100%, 75%);
17-
font-size: 24px;
1826
font-weight: bold;
1927
}

foundations/02-class-id-selectors/solution/solution.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
<body>
1111
<p class="odd">Number 1 - I'm a class!</p>
1212
<div id="two">Number 2 - I'm one ID.</div>
13-
<p class="odd oddly-cool">Number 3 - I'm a class, but cooler!</p>
14-
<div id="four">Number 4 - I'm another ID.</div>
13+
<p class="odd adjust-font-size">Number 3 - I'm a class, but cooler!</p>
14+
<div id="four" class="adjust-font-size">Number 4 - I'm another ID.</div>
1515
<p class="odd">Number 5 - I'm a class!</p>
1616
</body>
1717
</html>

0 commit comments

Comments
 (0)