css - Sidebar with 100% height and scrolling content area -
i'm using bootstrap twitter , designed fluid layout fixed navbar , footer. still need fixed left sidebar 100% height , content area scrolls if necessary.
i'd use browser's default vertical scrollbar, mean, don't want use overflow-y in content div. saw on html5 websites , i'd same.
can me?
here code i'm using: http://jsfiddle.net/julianonunes/ahk3c/2/embedded/result/
<!-- part 1: wrap page content here --> <div id="wrap"> <!-- fixed navbar --> <div class="navbar navbar-fixed-top"> <div class="navbar-inner"> <a class="brand" href="#"> texto</a> <ul class="nav pull-right"> <li><a href="#">dashboard</a> </li> <li class=""><a href="#">link</a> </li> </ul> </div> </div> <!-- begin page content --> <div class="container-fluid no-padding header-margin"> <div class="row-fluid"> <div class="span2"> <div class="well sidebar-nav"> <ul class="nav nav-list"> <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> </div> <div class="span10"> <div class="panel-middle-top"> <div class="middle-top-left"></div> <div class="middle-top-center"> <ul class="breadcrumb" style="background-color: transparent;"> <li><a href="/">home</a> <span class="divider">/</span> </li> <li class="active">link</li> </ul> </div> <div class="middle-top-right"></div> </div> <div class="panel-middle-content"></div> </div> </div> </div> <div id="push"></div> </div> <div id="footer"> <div class="container"> <p class="muted credit">copyright <a href="#">site</a> 2013.</p> </div> </div>
thanks.
your footer not fixed ... rather pushed bottom of page when content shorter ("sticky"). make fixed need make have like:
position:fixed; width:100%; bottom:0;
and sidebar can make this, spans between fixed header , footer (with top
, bottom
, can here make span way want):
.sidebar-nav { position:fixed; top:52px; bottom:52px; width:12%; }
note: position set fixed
, element gets positioned in similar way absolute
(so can set boundaries/span defining top
, bottom
, left
, right
), instead of being positioned relative 1 of parent html elements, fixed element gets positioned relative browser window/viewport. here quite post on position
property, if want read more.
Comments
Post a Comment