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

css – responsive layout having only two columns instead of five

a grid with five columns
col_space are equal and flexible and they are just for space
col_1 and col_2 are content columns and fixed size
question – can I have the same funcionality without col_space at all ?

just like this:

<div class='wrap'>
<div class='col_1'>lorem</div>
<div class='col_2'>ipsum</div>
</div>
.wrap{
display:grid;
grid-template-columns:1fr 99px 1fr 54px 1fr;
height:50vh;
}

.col_space{background:lightblue;}
.col_1, .col_2{background:orange;}
<div class='wrap'>
<div class='col_space'></div>
<div class='col_1'>lorem</div>
<div class='col_space'></div>
<div class='col_2'>ipsum</div>
<div class='col_space'></div>
</div>

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 :

space-evenly on justify—content will do this,

.wrap{
display:grid;
grid-template-columns:99px 54px;
height:50vh;
justify-content: space-evenly;
}

.wrap{background:lightblue;}
.col_1, .col_2{background:orange;}
<div class='wrap'>
<div class='col_1'>lorem</div>
<div class='col_1'>ipsum</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