Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Is it possible to get such a layout using grid?

enter image description here

Are there ways to use grid in my case?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You can adjust the margin for the 5th, 11th and 12th items.

.wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr 1fr;
  gap: 32px;
  max-width: 800px;
  500px
}

.item {
   background-color: lightgrey;
   border: 1px solid black;
   padding: 20px;
}

.item:nth-child(1) {
   grid-column: span 3;
}

.item:nth-child(3) {
   grid-column: span 2;
}

.item:nth-child(4) {
   grid-row: span 2;
    grid-column: span 2;
}

.item:nth-child(5) {
    grid-row: span 2;
    grid-column: span 2;
    margin-bottom: -30px;
}

.item:nth-child(6) {
   grid-column: span 2;
}

.item:nth-child(11) {
       margin-top: 20px;
}

.item:nth-child(12) {
      margin-top: 20px;
}

.item:nth-child(13) {
   grid-column: span 2;
}
<div class="wrapper">
        <div class="item"></div>
         <div class="item"></div>
         <div class="item"></div>
         <div class="item"></div>
         <div class="item"></div>
         <div class="item"></div>
         <div class="item"></div>
         <div class="item"></div>
         <div class="item"></div>
         <div class="item"></div>
         <div class="item"></div>
         <div class="item"></div>
         <div class="item"></div>
      </div>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading