Auto height for left navigation (Span3) bootstrap

Hi,

I am making a page that required left navigation i.e.(Span3) height 100% and always should touch header and footer, I tried the things but not worked,

I am not upload full HTML and CSS files of my page, just giving here scratch code with some CSS and HTML, I hope this would be fine…

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bootstrap, from Twitter</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">

<!-- Le styles -->
<link href="http://getbootstrap.com/2.3.2/assets/css/bootstrap.css" rel="stylesheet">
<style></style>
<style type="text/css">
/* Sticky footer styles
  -------------------------------------------------- */

  html,  body {
    height: 100%;/* The html and body elements cannot have any padding or margin. */
  }
/* Wrapper for page content to push down footer */
  #wrap {
    min-height: 100%;
    height: auto !important;
    height: 100%;
    /* Negative indent footer by it's height */
    margin: 0 auto -60px;
}
/* Set the fixed height of the footer here */
  #push,  #footer {
    height: 60px;
}
#footer {
    background-color: #f5f5f5;
}

  /* Lastly, apply responsive CSS fixes as necessary */
  @media (max-width: 767px) {
#footer {
    margin-left: -20px;
    margin-right: -20px;
    padding-left: 20px;
    padding-right: 20px;
}
}
/* Custom page CSS
  -------------------------------------------------- */
  /* Not required for template or sticky footer method. */

  #wrap > .container {
    padding-top: 60px;
}
.container .credit {
    margin: 20px 0;
}
code {
    font-size: 80%;
}
.tooltip-test{
    clear:both;
    background:#ccc;    
}

.leftNavContent{
background: #ccc;
border-right: 1px solid #666;
}

</style>
<link href="http://getbootstrap.com/2.3.2/assets/css/bootstrap-responsive.css" rel="stylesheet">

<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
      <script src="http://getbootstrap.com/2.3.2/assets/js/html5shiv.js"></script>
    <![endif]-->

<!-- Fav and touch icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="http://getbootstrap.com/2.3.2/assets/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="http://getbootstrap.com/2.3.2/assets/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="http://getbootstrap.com/2.3.2/assets/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="http://getbootstrap.com/2.3.2/assets/ico/apple-touch-icon-57-precomposed.png">
<link rel="shortcut icon" href="http://getbootstrap.com/2.3.2/assets/ico/favicon.png">
</head>

<body>
<div id="wrap"> 

        <!-- Fixed navbar -->
        <div class="navbar">
                <div class="navbar-inner">
                        <div class="container">
                                <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button>
                                <a class="brand" href="#">Project name</a>
                                <div class="nav-collapse collapse">
                                        <ul class="nav">
                                                <li class="active"><a href="#">Home</a></li>
                                                <li><a href="#about">About</a></li>
                                                <li><a href="#contact">Contact</a></li>
                                                <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
                                                        <ul class="dropdown-menu">
                                                                <li><a href="#">Action</a></li>
                                                                <li><a href="#">Another action</a></li>
                                                                <li><a href="#">Something else here</a></li>
                                                                <li class="divider"></li>
                                                                <li class="nav-header">Nav header</li>
                                                                <li><a href="#">Separated link</a></li>
                                                                <li><a href="#">One more separated link</a></li>
                                                        </ul>
                                                </li>
                                        </ul>
                                </div>
                                <!--/.nav-collapse --> 
                        </div>
                </div>
        </div>

        <!-- Begin page content -->
        <div class="container-fluid">
                <div class="row">
                        <div class="span3 leftNavContent">
                                <ul class="nav nav-list nav-list_">
                                        <div class="quickLinks">
                                                <div class="LastloginInfo"> <strong>Last Login</strong> 9/22/2014 02:52:39 AM </div>
                                                <ul>
                                                        <li><a href="#" class="current">Manage Tickets (198)</a></li>
                                                        <li><a href="#">Support Tickets</a></li>
                                                        <li><a href="#">Billing Tickets</a></li>
                                                        <li><a href="#">Order Tickets</a></li>
                                                        <li><a href="#">Ticket Reports</a></li>
                                                </ul>
                                        </div>
                                </ul>
                        </div>
                        <div class="span9">
                                <ul class="breadcrumb">
                                        <li><a href="#">Home</a> <span class="divider">/</span></li>
                                        <li><a href="#">Library</a> <span class="divider">/</span></li>
                                        <li class="active">Data</li>
                                </ul>
                                <div class="tooltip-test">
                                <p>Test Tooltip <a class="myTip" href="#" data-toggle="tooltip" data-trigger="hover"  title="first tooltip">hover over me</a></p>

                                </div>

                        </div>
                </div>
                <!-- ROW --> 
        </div>
        <!-- container -->

        <div id="push"></div>
</div>
<!-- wrap -->

<div id="footer">
        <div class="container">
                <p class="muted credit">Example courtesy <a href="http://martinbean.co.uk">Martin Bean</a> and <a href="http://ryanfait.com/sticky-footer/">Ryan Fait</a>.</p>
        </div>
</div>

<!-- Le javascript
    ================================================== --> 
<!-- Placed at the end of the document so the pages load faster --> 
<script src="http://getbootstrap.com/2.3.2/assets/js/jquery.js"></script> 
<script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-transition.js"></script> 
<script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-alert.js"></script> 
<script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-modal.js"></script> 
<script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-dropdown.js"></script> 
<script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-scrollspy.js"></script> 
<script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-tab.js"></script> 
<script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-tooltip.js"></script> 
<script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-popover.js"></script> 
<script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-button.js"></script> 
<script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-collapse.js"></script> 
<script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-carousel.js"></script> 
<script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-typeahead.js"></script>

Hi,

You can’t do this with bootstrap classes and bootstrap’s sticky footer is a bit of an abomination. The Ryan Fait version has never worked properly ever since it was posted (it was a poor copy of my original and had many flaws in various browsers). Irrespective of that it is useless for responsive web design anyway s it is a fixed height and has stupid pushers to accommodate it.

My sticky footer version is the best one to use and needs no pushers or fixed heights and worked well in responsive layouts.

Regarding the full height column then you can’t do this in bootstrap either and you would need display:table properties to ths properly (and easily).

I’ve updated your code to use these techniques but I feel this may be a step too far for you as it over-rides some of the bootsrap styles to achieve its layout.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bootstrap, from Twitter</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">

<!-- Le styles -->
<link href="http://getbootstrap.com/2.3.2/assets/css/bootstrap.css" rel="stylesheet">
<style></style>
<style type="text/css">
/* Sticky footer styles
  -------------------------------------------------- */

html, body {
	height: 100%;/* The html and body elements cannot have any padding or margin. */
	margin:0;
	padding:0;
}
#wrap {
	height: 100%;
	margin: 0 auto;
	display:table;
	width:100%;
}
#footer {
	height:1px;/* sticky footer technique*/
	display:table-row;
}
#footer {
	background-color: #f5f5f5;
}

/* Lastly, apply responsive CSS fixes as necessary */
@media (max-width: 767px) {
#footer {
	margin-left: -20px;
	margin-right: -20px;
	padding-left: 20px;
	padding-right: 20px;
}
}
/* Custom page CSS
  -------------------------------------------------- */
  /* Not required for template or sticky footer method. */
.container .credit {
	margin: 20px 0;
}
code {
	font-size: 80%;
}
.tooltip-test {
	clear:both;
	background:#ccc;
}
.leftNavContent {
	background: #ccc;
	border-right: 1px solid #666;
}
.table-wrap {
	width:100%;
	display:table;
	height:100%;
}
.table-row {
	display:table-row;
	float:none!important;
}
.table-cell {
	display:table-cell;
	vertical-align:top;
	float:none!important;
	padding:20px 10px;
}
.leftNavContent {
	background:#ccc;
}
.table-wrap:before, .table-wrap:after, .table-row:before, .table-row:after, .table-cell:before, .table-cell:after {
	display:none
}
.table-wrap, .table-row, .table-cell {
	-webkit-box-sizing:border-box;
	-moz-box-sizing:border-box;
	box-sizing:border-box;
}
.navbar {
	margin-bottom:0;
	display:table-row;
	height:1px;
}
</style>
<link href="http://getbootstrap.com/2.3.2/assets/css/bootstrap-responsive.css" rel="stylesheet">

<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
    <script src="http://getbootstrap.com/2.3.2/assets/js/html5shiv.js"></script>
<![endif]-->

<!-- Fav and touch icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="http://getbootstrap.com/2.3.2/assets/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="http://getbootstrap.com/2.3.2/assets/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="http://getbootstrap.com/2.3.2/assets/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="http://getbootstrap.com/2.3.2/assets/ico/apple-touch-icon-57-precomposed.png">
<link rel="shortcut icon" href="http://getbootstrap.com/2.3.2/assets/ico/favicon.png">
</head>

<body>
<div id="wrap"> 
		<!-- Fixed navbar -->
		<div class="navbar">
				<div class="navbar-inner">
						<div class="container">
								<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button>
								<a class="brand" href="#">Project name</a>
								<div class="nav-collapse collapse">
										<ul class="nav">
												<li class="active"><a href="#">Home</a></li>
												<li><a href="#about">About</a></li>
												<li><a href="#contact">Contact</a></li>
												<li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
														<ul class="dropdown-menu">
																<li><a href="#">Action</a></li>
																<li><a href="#">Another action</a></li>
																<li><a href="#">Something else here</a></li>
																<li class="divider"></li>
																<li class="nav-header">Nav header</li>
																<li><a href="#">Separated link</a></li>
																<li><a href="#">One more separated link</a></li>
														</ul>
												</li>
										</ul>
								</div>
								<!--/.nav-collapse --> 
						</div>
				</div>
		</div>
		<!-- remove midwrap if you don;t want a gap above and below the side column -->
		<div class="table-cell mid-wrap"> 
				<!-- Begin page content -->
				<div class="container-fluid table-wrap">
						<div class="row table-row">
								<div class="span3 leftNavContent table-cell">
										<ul class="nav nav-list nav-list_">
												<div class="quickLinks">
														<div class="LastloginInfo"> <strong>Last Login</strong> 9/22/2014 02:52:39 AM </div>
														<ul>
																<li><a href="#" class="current">Manage Tickets (198)</a></li>
																<li><a href="#">Support Tickets</a></li>
																<li><a href="#">Billing Tickets</a></li>
																<li><a href="#">Order Tickets</a></li>
																<li><a href="#">Ticket Reports</a></li>
														</ul>
												</div>
										</ul>
								</div>
								<div class="span9 table-cell">
										<ul class="breadcrumb">
												<li><a href="#">Home</a> <span class="divider">/</span></li>
												<li><a href="#">Library</a> <span class="divider">/</span></li>
												<li class="active">Data</li>
										</ul>
										<div class="tooltip-test">
												<p>Test Tooltip <a class="myTip" href="#" data-toggle="tooltip" data-trigger="hover"  title="first tooltip">hover over me</a></p>
										</div>
								</div>
						</div>
				</div>
		</div>
		<!-- container -->
		<div id="footer">
				<div class="container">
						<p class="muted credit">Example courtesy <a href="#">Paul O' Brien</a>.</p>
				</div>
		</div>
</div>
<!-- wrap --> 

<!-- Le javascript
    ================================================== --> 
<!-- Placed at the end of the document so the pages load faster --> 
<script src="http://getbootstrap.com/2.3.2/assets/js/jquery.js"></script> 
<script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-transition.js"></script> 
<script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-alert.js"></script> 
<script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-modal.js"></script> 
<script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-dropdown.js"></script> 
<script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-scrollspy.js"></script> 
<script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-tab.js"></script> 
<script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-tooltip.js"></script> 
<script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-popover.js"></script> 
<script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-button.js"></script> 
<script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-collapse.js"></script> 
<script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-carousel.js"></script> 
<script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-typeahead.js"></script>
</body>
</html>

The left column will only be full height in modern browsers and content height in others. The sticky footer will work back to IE8 and contain as much or as little content as you like and will work in a fluid layout.

I also left a small gap above and below the left column but to remove it remove the ‘midwrap’ div from the html (opening and closing tags).

However, as I mentioned above this may be a bit too far for you to understand at this stage and maybe you should consider losing the sticky footer and full length side columns and just stick with the bootstrap basics. :smile:

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.