I am trying to do the layout that can be seen in the image below:
It is full screen, the header and footer have fixed height (60px), the green sidebar is 200px wide; both the sidebar and the section on the right side occupy the entire available space on the y axis.
For wide screens, I want to divide the right side into 4 equal boxes, displayed 2 by 2.
For medium and small screens (< 768px), I want to display the 4 equal boxes 1 by 4, like the image below:
The HTML I have:
<div id="wrapper">
<div id="header">Header</div>
<div id="content">
<div id="left"></div>
<div id="right">
<div class="red_box"></div>
<div class="red_box"></div>
<div class="red_box"></div>
<div class="red_box"></div>
</div>
</div>
<div id="footer">Footer</div>
</div>
The CSS I have:
html {
height: 100%;
}
body {
height: 100%;
position: relative;
}
#wrapper {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
height: 100%;
padding: 60px 0;
position: relative;
}
#header {
width: 100%;
height: 60px;
background: #171717;
position: absolute;
top: 0;
left: 0;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
#content {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
height:100%;
background: gray;
display: flex;
}
#left {
background: green;
width: 200px;
flex: 0 0 200px;
}
#right {
background: red;
width: 100%;
position: relative;
}
#footer {
width: 100%;
height: 60px;
background: #171717;
bottom: 0;
left: 0;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
How do I style those red boxes to achieve the 2 layouts, if possible, without using display:table and display:table-cell, as this will create problems with positioning items absolutely inside the red boxes on Firefox?
Thank you!