diff --git a/readme.md b/readme.md index 3a460b48..5714b57f 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://ilona-borkovska.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..12c70948 100644 --- a/src/styles/_catalog.scss +++ b/src/styles/_catalog.scss @@ -1,10 +1,26 @@ .catalog { - display: flex; - flex-wrap: wrap; + display: grid; + grid-template-columns: repeat(auto-fill, 200px); + grid-template-rows: auto; + + justify-content: center; + gap: 48px; max-width: 944px; margin: 0 auto; + @media (min-width: 768px) and (max-width: 1024px) { + grid-template-columns: repeat(3, 200px); + } + + @media (min-width: 488px) and (max-width: 768px) { + grid-template-columns: repeat(2, 200px); + } + + @media (max-width: 488px) { + grid-template-columns: 200px; + } + &__card { display: flex; justify-content: center; @@ -13,10 +29,5 @@ height: 300px; border: 1px solid #ccc; border-radius: 5px; - margin-bottom: 48px; - } - - &__card:not(:nth-child(4n)) { - margin-right: 48px; } }