From adb38b9a1b2efc8308d0c7cce56d3acd1c771e8f Mon Sep 17 00:00:00 2001 From: usama ibrahim Date: Sun, 1 Oct 2023 10:51:10 +0100 Subject: [PATCH 1/2] completed exercise --- .vscode/settings.json | 3 ++ src/styles.css | 114 +++++++++++++++++++++++++++++++++++++++--- 2 files changed, 109 insertions(+), 8 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..f673a71 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "liveServer.settings.port": 5502 +} \ No newline at end of file diff --git a/src/styles.css b/src/styles.css index 59fd797..f450fb7 100644 --- a/src/styles.css +++ b/src/styles.css @@ -39,18 +39,116 @@ https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Selectors */ -.two-column-grid__expand-two {} -.three-column-grid {} +.two-column-grid__expand-two { + display: grid; + grid-template: "logo box" 1fr/ + 150px 1fr; + gap: 10px; +} + +.two-column-grid__expand-two .logo { + grid-area: logo; +} + +.two-column-grid__expand-two .box { + grid-area: box; +} -.three-column-grid__expand-two {} +@media screen and (max-width: 600px) { + .two-column-grid__expand-two { + grid-template: "logo" 1fr + "box" 1fr/ + 1fr; + gap: 10px; + } +} -.five-column-grid {} +.three-column-grid { + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 10px; +} -.center-grid {} +@media screen and (max-width: 600px) { + .three-column-grid { + grid-template-columns: repeat(1, 1fr); + } +} -.grid-in-grid-1 {} +.three-column-grid__expand-two { + display: grid; + grid-template: + "box box box" 1fr/ + 50px 1fr 50px; + gap: 10px; +} -.grid-in-grid-2 {} +@media screen and (max-width: 600px){ + .three-column-grid__expand-two { + grid-template: + "box" + "box" + "box"; + } +} + +.five-column-grid { + display: grid; + grid-template-columns: repeat(5, 1fr); + gap: 10px; +} + +@media screen and (max-width: 600px){ + .five-column-grid { + grid-template-columns: 1fr 1fr; + } +} + +.center-grid { + display: flex; + justify-content: center; +} + +.centered { + width: 200px; +} + +@media screen and (max-width: 600px){ + .centered { + width: 100px; + } +} + +.grid-in-grid-1 { + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: 10px; +} + +.grid-in-grid-1 .box:nth-child(1) { + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 10px; +} + +.grid-in-grid-1 .box:nth-child(2){ + display: grid; + grid-template-columns: repeat(5, 1fr); + gap: 10px; +} + +.grid-in-grid-2 { + display: grid; + grid-template: + "box box box" 1fr/ + 100px 1fr 200px; + gap: 10px; +} + +.grid-in-grid-2 .box:nth-child(3) { + display: grid; + grid-template-columns: repeat(3, 1fr); +} -.grid-madness {} +/* .grid-madness {} */ From 27c6e69e43f6ecb2d33d053edab66ee5f1749a9c Mon Sep 17 00:00:00 2001 From: usama ibrahim Date: Mon, 2 Oct 2023 00:59:25 +0100 Subject: [PATCH 2/2] completed exercise --- src/index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.html b/src/index.html index 7964e5f..bf7c782 100644 --- a/src/index.html +++ b/src/index.html @@ -148,3 +148,4 @@

Grid madness (extension)

+