I am attempting to design a 3-column layout in CSS with one column that can be toggled on and off. The diagram below illustrates the layout.
I want all three columns to be full height.
- In red: A fixed-width column
- In green: A toggleable menu
- In dark green: The menu once toggled
- In white: The main container that should occupy the remaining space
I have made an attempt using the following code, but it has not been successful:
<div id="header"></div>
<div id="inline_container">
<div id="left_menu"></div>
<div id="toggle_menu"></div>
<div id="main_container"></div>
</div>
Here is the corresponding CSS code:
* {margin: 0; padding: 0;}
.body {height: 100%; width: 100%;}
#header {height: 70px; width: 100%;}
#inline_container {height: 95%; width: 100%;}
#left_menu {height: 100%; width: 80px; display: inline-block; float: left;}
#toggle_menu {height: 100%; width: 150px; display: inline-block; float: left;}
#main_container {height: 100%; width: 100%; display: inline-block; float: left;}