Flexbox 3 Columns Code Example


Example 1: flexbox grid


.container {
max-width: 1335px;
margin: 0 auto;
}
.grid-row {
display: flex;
flex-flow: row wrap;
justify-content: flex-start;
}
.grid-item {
height: 550px; /*optional*/
flex-basis: 20%; /* initial percantage */
-ms-flex: auto;
width: 259px; /*optional*/
position: relative;
padding: 10px; /*optional*/
box-sizing: border-box;
}
@media(max-width: 1333px) {/*xl*/
.grid-item {
flex-basis: 33.33%;
}
}
@media(max-width: 1073px) {/*lg*/
.grid-item {
flex-basis: 33.33%;
}
}
@media(max-width: 815px) {/*md*/
.grid-item {
flex-basis: 50%;
}
}
@media(max-width: 555px) {/*sm*/
.grid-item {
flex-basis: 100%;
}
}

Example 2: flex grid 3 columns


<div class="row around-xs">
<div class="col-xs-2">
<div class="box">
around
</div>
</div>
<div class="col-xs-2">
<div class="box">
around
</div>
</div>
<div class="col-xs-2">
<div class="box">
around
</div>
</div>
</div>

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable