Within my HTML structure, I have three vertical divs that each contain multiple inner div elements.
I am looking to achieve a responsive layout where the inner divs wrap into either a 2-column or 1-column grid based on the browser's height and width. As the browser is resized, I want the inner divs to adjust their size dynamically to fill any extra space left over from wrapping.
When resizing the browser, the layout should look like the image shown below:
Here is the current structure of my HTML code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<style type="text/css">
body {
height: 100%;
font-size: 100%;
}
.main {
border: 2px solid black;
position: absolute !important;
width: 100% !important;
height: 100% !important;
left: 0px !important;
top: 0px !important;
z-index: 1 !important;
box-sizing: border-box;
-moz-box-sizing: border-box;
overflow: hidden;
}
.verticalReports {
width: 32%;
border: 1px solid black;
height: 100%;
float: left;
overflow:hidden;
}
.verticalTiles {
width: 30%;
height: 20%;
background-color: #e0d8ed;
margin-left: 10px;
margin-top: 13px;
float: left;
}
</style>
</head>
<body>
<div class="main">
<div class="verticalReports">
<div class="verticalTiles"></div>
<div class="verticalTiles"></div>
<div class="verticalTiles"></div>
<div class="verticalTiles"></div>
<div class="verticalTiles"></div>
<div class="verticalTiles"></div>
<div class="verticalTiles"></div>
<div class="verticalTiles"></div>
<div class="verticalTiles"></div>
<div class="verticalTiles"></div>
<div class="verticalTiles"></div>
<div class="verticalTiles"></div>
<div class="verticalTiles"></div>
</div>
<div class="verticalReports">
<div class="verticalTiles"></div>
<div class="verticalTiles"></div>
<div class="verticalTiles"></div>
<div class="verticalTiles"></div>
<div class="verticalTiles"></div>
<div class="verticalTiles"></div>
<div class="verticalTiles"></div>
<div class="verticalTiles"></div>
<div class="verticalTiles"></div>
<div class="verticalTiles"></div>
<div class="verticalTiles"></div>
<div class="verticalTiles"></div>
<div class="verticalTiles"></div>
</div>
<div class="verticalReports">
<div class="verticalTiles"></div>
<div class="verticalTiles"></div>
<div class="verticalTiles"></div>
<div class="verticalTiles"></div>
<div class="verticalTiles"></div>
<div class="verticalTiles"></div>
<div class="verticalTiles"></div>
<div class="verticalTiles"></div>
<div class="verticalTiles"></div>
<div class="verticalTiles"></div>
<div class="verticalTiles"></div>
<div class="verticalTiles"></div>
<div class="verticalTiles"></div>
</div>
</div>
</body>
</html>