Source code
Revision control
Copy as Markdown
Other Tools
<!DOCTYPE html>
<link rel="author" title="Kevin Babbitt" href="mailto:kbabbitt@microsoft.com">
<style>
body {
margin: 0px;
}
.section {
position: relative;
margin-bottom: 20px;
}
.flex {
display: flex;
flex-wrap: wrap;
gap: 10px;
width: 230px;
}
.flex > * {
background: lightgray;
width: 50px;
height: 50px;
}
.col-rule {
position: absolute;
width: 10px;
height: 170px;
top: 0px;
}
.row-rule {
position: absolute;
height: 10px;
width: 230px;
left: 0px;
}
</style>
<!-- direction: ltr — column colors left-to-right: red, green, blue.
Row colors top-to-bottom: orange, purple. -->
<div class="section">
<div class="col-rule" style="left: 50px; background: red;"></div>
<div class="col-rule" style="left: 110px; background: green;"></div>
<div class="col-rule" style="left: 170px; background: blue;"></div>
<div class="row-rule" style="top: 50px; background: orange;"></div>
<div class="row-rule" style="top: 110px; background: purple;"></div>
<div class="flex" style="direction: ltr;">
<div></div><div></div><div></div><div></div>
<div></div><div></div><div></div><div></div>
<div></div><div></div><div></div><div></div>
</div>
</div>
<!-- direction: rtl — column colors reversed: blue, green, red left-to-right.
Row colors unchanged: orange, purple. -->
<div class="section">
<div class="col-rule" style="left: 50px; background: blue;"></div>
<div class="col-rule" style="left: 110px; background: green;"></div>
<div class="col-rule" style="left: 170px; background: red;"></div>
<div class="row-rule" style="top: 50px; background: orange;"></div>
<div class="row-rule" style="top: 110px; background: purple;"></div>
<div class="flex" style="direction: rtl;">
<div></div><div></div><div></div><div></div>
<div></div><div></div><div></div><div></div>
<div></div><div></div><div></div><div></div>
</div>
</div>