Completed exercise 02 in another way

Further explanation in README on Solution section
This commit is contained in:
NetMan 2023-12-28 18:43:29 +01:00
parent 0d2bcd0903
commit 0cfdc007c7
2 changed files with 24 additions and 0 deletions

View File

@ -23,3 +23,8 @@ Quick tip: in VS Code, you can change which format colors are displayed in RGB,
- Do the odd numbered `p` elements share a class?
- Do the even numbered `div` elements have unique IDs?
- Does the Number 3 element have multiple classes?
## Solution
Used nth-child and did not touch the HTML file at all, only used CSS and didn't focus on elements being either p or div, only relying on nth-child
There are no IDs or classes used

View File

@ -0,0 +1,19 @@
body > *:nth-child(2n+1) {
background-color: pink;
font-family: Verdana, "DejaVu Sans", sans-serif;
}
body > *:nth-child(2) {
color: blue;
font-size: 36px;
}
body > *:nth-child(3) {
font-size: 24px;
}
body > *:nth-child(4) {
font-size: 24px;
background-color: lightgreen;
font-weight: bold;
}