diff --git a/readme.md b/readme.md index 3a460b48..eb24a4a7 100644 --- a/readme.md +++ b/readme.md @@ -1,6 +1,6 @@ # Frontend practice with catalog page using grid Replace `` with your Github username and copy the links to Pull Request description: -- [DEMO LINK](https://.github.io/layout_catalog_grid/) +- [DEMO LINK](https://hsromnc.github.io/layout_catalog_grid/) > Follow [this instructions](https://github.com/mate-academy/layout_task-guideline#how-to-solve-the-layout-tasks-on-github) diff --git a/src/index.html b/src/index.html index af41a22d..3058b188 100644 --- a/src/index.html +++ b/src/index.html @@ -17,35 +17,35 @@
- diff --git a/src/styles/_catalog.scss b/src/styles/_catalog.scss index a63c46d7..4b9a67f2 100644 --- a/src/styles/_catalog.scss +++ b/src/styles/_catalog.scss @@ -1,22 +1,47 @@ .catalog { - display: flex; - flex-wrap: wrap; + --column-count: 1; + display: grid; + grid-template-columns: repeat(var(--column-count), 200px); + gap: 48px 48px; max-width: 944px; margin: 0 auto; &__card { - display: flex; + display: grid; justify-content: center; align-items: center; width: 200px; height: 300px; border: 1px solid #ccc; border-radius: 5px; - margin-bottom: 48px; } &__card:not(:nth-child(4n)) { margin-right: 48px; } } + +@media (max-width: 488px) { + .catalog { + --column-count: 1; + } +} + +@media (min-width: 488px) { + .catalog { + --column-count: 2; + } +} + +@media (min-width: 768px) { + .catalog { + --column-count: 3; + } +} + +@media (min-width: 1024px) { + .catalog { + --column-count: 4; + } +}