I have problem in layout of page in css. I have sidebar that height doesn't 100%. I want to show sidebar in 100%, but I can't. how to increase height of sidebar to 100%. I have .container-fluid
with position: relative
and .sidebar
with position: relative
.
this is my code:
body {
background-color: #e8e8e8;
font-family: 'Open Sans';
height:100%
}
#sidebar {
padding-right: 0px;
padding-left: 0px;
}
.sidebar {
width: 220px;
position: absolute;
padding-left: 0;
padding-right: 0;
height: 100%;
z-index: 100;
-webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.15);
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.15);
background-color: #222A2D;
}
.container-fluid {
position: relative;
padding-right: 0;
padding-left: 0;
margin-right: auto;
margin-left: auto;
}
.main {
margin-left: 0;
min-height: 100%;
padding: 0;
margin-right: 15px;
color:red;
padding-left: 250px;
}
<body id="mainbody">
<div class="container-fluid">
<header>Header</header>
<div class="sidebar" id="sidebar">
<ul>
<li>menu1</li>
<li>menu2</li>
<li>menu3</li>
</ul>
</div>
<div class="main" id="main">
Main content
<br>
Main content
<br>Main content
<br>Main content
<br>Main content
<br>Main content
<br>Main content
<br>Main content
<br>Main content
<br>Main content
<br>Main content
<br>
</div>
</div>
</body>