I would like to implement a grid of squares for navigation purposes.
By squares, I mean that the colored areas should have equal width and height.
Currently, I have achieved this using JavaScript, but I am interested in a CSS-only solution. My project is based on Bootstrap.
<div class="container">
<div class="row">
<div class="col-4" style="background-color: lightgray"></div>
<div class="col-4" style="background-color: lightgreen"></div>
<div class="col-4" style="background-color: lightgray"></div>
<div class="col-4" style="background-color: lightgreen"></div>
<div class="col-4" style="background-color: lightgray"></div>
<div class="col-4" style="background-color: lightgreen"></div>
</div>
</div>
var divs = $(".row > div");
var width = divs.width();
divs.height(width)
Is there a way to achieve this layout with just CSS?