<div class="flex-container space-between" style="width: 100%; justify-content: space-around;">
<div class="side flex-col flex-container">
<h1>Gap between items with direction = <u><i>row</i></u></h1>
<h2>gap: 20px <small>(set the gap between columns & rows to 20px)</small></h2>
<div class="flex-wrap flex-container" style="gap: 20px">
<div>1</div>
<div>2</div>
<div>3</div>
</div>
<h2>gap: 10px 20px <small>(gap composition when the first value repsents rows gap & the second value is for column gap)</small></h2>
<div class="flex-wrap flex-container" style="gap: 10px 20px">
<div>1</div>
<div>2</div>
<div>3</div>
</div>
<h2>column-gap: 20px </h2>
<div class="flex-wrap flex-container" style="column-gap: 20px">
<div>1</div>
<div>2</div>
<div>3</div>
</div>
<h2>row-gap: 20px </h2>
<div class="flex-wrap flex-container" style="row-gap: 20px">
<div>1</div>
<div>2</div>
<div>3</div>
</div>
</div>
</div>
.flex-container {
display: flex;
margin-bottom: 15px;
}
.flex-wrap {
flex-wrap: wrap;
}
/* General styles */
small {
font-size: .75em;
display: block;
font-style: italic;
color: gray;
}
.flex-row {
flex-direction: row;
}
.flex-col {
flex-direction: column;
}
.side {
min-width: 250px;
}
.side + .side {
margin-left: 15px;
}
.side .flex-container {
background-color: lightblue;
border: 2px solid #000;
}
.side .flex-container div {
background-color: lightgreen;
padding: 10px;
text-align:center;
border: 2px solid lightblue;
flex: 0 0 40%;
}
h1, h2 {
margin-top: 0;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.