Bootstrap - Column with position fixed.

by Kyle Mitofsky

HTML

<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="http://getbootstrap.com/dist/css/bootstrap.css">
<div class="row">
    <div class="col-xs-9" id="content">C</div> 
    <div class="col-xs-3">
        <div id="navbar-relative">Relative</div>
    </div>
</div>

<br/>

<div class="row">
    <div class="col-xs-9" id="content">C</div> 
    <div class="col-xs-3">
        <div id="navbar-fixed">Fixed</div>
    </div>
</div>




<!-- Post Info -->
<div style='position:fixed;bottom:0;left:0;    
            background:lightgray;width:100%;'>
    About this SO Question: <a href='http://stackoverflow.com/q/23616847/1366033'>Adding a responsive image to a position fixed div within a Bootstrap column</a><br/>
    Fork This Skeleton Here <a href='http://jsfiddle.net/KyleMit/kcpma/'>Bootrsap 3.0 Skeleton</a><br/>
<div>

CSS

#content{
    background: lightgray;
}
#navbar-relative{
    background: yellow;
    position: relative;
}
#navbar-fixed{
    background: yellow;
    position: fixed;
    width: 25%;
}

JavaScript

$(function() {
    $(window).resize(function() {
        $('#width-placeholder').html($("#sidebar").width());
    }).resize();
});