fixed header with left floating
by Ea Bangalore
HTML
<div id="wrapper" class="toggled hidden-xs">
<!-- Sidebar -->
<div id="sidebar-wrapper">
<div class="header">
<h4>
Heading 1
</h4>
</div>
<ul class="sidebar-nav">
<li>hello world repeated long word</li>
<li>hello world</li>
<li>hello world</li>
<li>hello world</li>
<li>hello world</li>
<li>hello world hello world repeated long word</li>
<li>hello world</li>
<li>hello world</li>
<li>hello world</li>
<li>hello world</li>
<li>hello world</li>
<li>hello world</li>
<li>hello world</li>
<li>hello world</li>
<li>hello world</li>
<li>hello world</li>
<li>hello world</li>
<li>hello world</li>
<li>hello world</li>
<li>hello world</li>
</ul>
</div>
</div>
CSS
#wrapper {
padding-left: 0;
transition: all 0.5s ease;
height: 100%;
}
#sidebar-wrapper {
z-index: 1000;
position: fixed;
top: 0;
left: 0;
max-width: 180px;
width:175px;
height: calc(80vh - 6px); /* As you give a border of 3px */
overflow:auto;
background: rgba(0,0,0,0.9);
transition: all 0.5s ease;
border: 3px solid red;
color:white;
}
.header{
z-index: 100001;
color: #fff;
background-color: #000000;
padding: 5px;
display: block;
position: sticky;
top: 0;
text-align: center;
border-bottom: 1px solid red;
}