I have the following code:
<div class="main">
<!-- CONTENT -->
<div class="tabs">
<!-- CONTENT -->
</div> <!-- Closing div for .tabs -->
</div> <!-- Closing div for .main -->
.tabs{
position: fixed;
top:110px;
left:0px;
width:40px;
z-index:999
}
.main{
overflow: hidden;
margin: 0 0 100px;
box-shadow: 0 10px 16px rgba(0,0,0,0.33);
border-radius: 0px 0px 25px 25px;
position:relative;
}
From my understanding position:fixed
is always relative to the browser window not the containing element. However I would prefer the .tabs
div to be fixed but relative to the containing div. Is there anyway to have position fixed and have it relative to the containing element?