Source code
Revision control
Copy as Markdown
Other Tools
<!DOCTYPE html>
<link rel="help" href="https://www.w3.org/TR/css-gaps-1/">
<link rel="author" title="Sam Davis Omekara Jr." href="mailto:samomekarajr@microsoft.com">
<style>
body {
margin: 0px;
}
#flexbox {
width: 400px;
border: 2px solid #333;
background-color: #fff;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
row-gap: 10px;
}
.item {
width: 70px;
height: 50px;
background-color: #007bff;
color: white;
display: flex;
}
.rule {
position: absolute;
top: 2px;
height: 50px;
background: gold;
width: 5px;
}
.row-rule {
position: absolute;
display: inline;
height: 0px;
border-bottom: 5px solid red;
top: 54.5px;
}
</style>
<!-- Row 1 column rules (5 items, gap=12.5px) -->
<div class="rule" style="left: 75.75px;"></div>
<div class="rule" style="left: 158.25px;"></div>
<div class="rule" style="left: 240.75px;"></div>
<div class="rule" style="left: 323.25px;"></div>
<!-- Row 2 column rules (3 items, gap=95px) -->
<div class="rule" style="top: 62px; left: 117px;"></div>
<div class="rule" style="top: 62px; left: 282px;"></div>
<!-- Row rule segments (broken at intersections, 2 overlap windows suppress 2 segments) -->
<div class="row-rule" style="left: 2px; width: 70px;"></div>
<div class="row-rule" style="left: 167px; width: 70px;"></div>
<div class="row-rule" style="left: 332px; width: 70px;"></div>
<div id="flexbox">
<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>