Completed exercise 03 in another way

Further explanation in README in Solution section

Solution similar to exercise 02
This commit is contained in:
NetMan 2023-12-28 18:46:48 +01:00
parent 0cfdc007c7
commit d031f5ee79
2 changed files with 17 additions and 0 deletions

View File

@ -18,3 +18,7 @@ This will help you further practice adding classes and using class selectors, so
- Does each element have a unique class name? - Does each element have a unique class name?
- Did you use the grouping selector for styles that both elements share? - Did you use the grouping selector for styles that both elements share?
- Did you make separate rules for the styles unique to each element? - Did you make separate rules for the styles unique to each element?
# Solution
The same as in exercise 02, instead of classes, IDs, element names, I used nth-child and * to point to elements.

View File

@ -0,0 +1,13 @@
body > *:nth-child(1) {
background-color: black;
color: white;
}
body > *:nth-child(2) {
background-color: yellow;
}
body > * {
font-size: 28px;
font-family: Helvetica, "Times New Roman", sans-serif;
}