Completed exercise 02 in another way
Further explanation in README on Solution section
This commit is contained in:
parent
0d2bcd0903
commit
0cfdc007c7
|
@ -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
|
|
@ -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;
|
||||
}
|
Loading…
Reference in New Issue