I'm working with two columns - col-md-8
and col-md-4
. In the second column, I have a fixed sidebar that I want to be 100% width of the col-md-4
column. The black box in the image below represents the second column.
Despite trying setting the width to 100%, it's not working as expected.
https://i.sstatic.net/vn1mr.png
Below is my current HTML code:
.col-md-4 {
border-style: solid;
}
.sidebar-nav-fixed {
height: 100%;
width: 15%;
text-align: center;
}
.well {
height: 100%;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
<div class="row">
<div class="col-md-8">
<div class="">
<h1>Hello, world!</h1>
</div>
</div>
<div class="col-md-4">
<div class="sidebar-nav-fixed affix">
<div class="well" id="world">
<ul class="nav ">
<li class="nav-header">Sidebar</li>
<li class="active"><a href="#">Link</a>
</li>
<li><a href="#">Link</a>
</li>
<li><a href="#">Link</a>
</li>
<li><a href="#">Link</a>
</li>
<li class="nav-header">Sidebar</li>
<li><a href="#">Link</a>
</li>
<li><a href="#">Link</a>
</li>
<li><a href="#">Link</a>
</li>
<li><a href="#">Link</a>
</li>
<li><a href="#">Link</a>
</li>
<li><a href="#">Link</a>
</li>
<li class="nav-header">Sidebar</li>
<li><a href="#">Link</a>
</li>
<li><a href="#">Link</a>
</li>
<li><a href="#">Link</a>
</li>
</ul>
</div>
<!--/.well -->
</div>
</div>
</div>
<!--/row-->
</div>