I am looking to maintain the aspect ratio of a DIV element, similar to how it's done on Google Maps.
<div id="map" style="background-color: grey;width:100%;"> Map here </div>
The current setup adjusts the width based on the window size or col-*
for bootstrap
.
However, I now want to ensure that the width-to-height ratio remains 1:1.
How can I achieve this?
A similar issue arises with images where I would like to maintain a square shape.
<img class="img-fluid" style="width:100%;">