From 0cfdc007c7d64923b0f880bec208978cc1d567d0 Mon Sep 17 00:00:00 2001 From: NetMan <13informatyka14@gmail.com> Date: Thu, 28 Dec 2023 18:43:29 +0100 Subject: [PATCH] Completed exercise 02 in another way Further explanation in README on Solution section --- 02-class-id-selectors/README.md | 5 +++++ 02-class-id-selectors/style.css | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/02-class-id-selectors/README.md b/02-class-id-selectors/README.md index a2a4c67..8283f86 100644 --- a/02-class-id-selectors/README.md +++ b/02-class-id-selectors/README.md @@ -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 \ No newline at end of file diff --git a/02-class-id-selectors/style.css b/02-class-id-selectors/style.css index e69de29..1513474 100644 --- a/02-class-id-selectors/style.css +++ b/02-class-id-selectors/style.css @@ -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; +}