Creating a 2 Column Fixed-Fluid Layout with Twitter Bootstrap
Introduction
Creating a layout with a fixed-width column alongside a fluid-width column is a common requirement for responsive web design. This layout style enables a fixed sidebar or navigation panel alongside a flexible content area that adapts to different screen sizes. Using Twitter Bootstrap, it is possible to achieve this layout.
Implementation
HTML
<div class="container-fluid fill"> <div class="row-fluid"> <div class="fixed"> ... </div> <div class="filler"> ... </div> </div> </div>
CSS
.fixed { width: 150px; float: left; } .fixed + div { margin-left: 150px; overflow: hidden; } .fill { min-height: 100%; position: relative; } .filler::after { background-color:inherit; bottom: 0; content: ""; height: auto; left: 0; position: absolute; top: 0; width: inherit; z-index: -1; }
Explanation
The above is the detailed content of How to Create a Fixed-Fluid Layout with Twitter Bootstrap?. For more information, please follow other related articles on the PHP Chinese website!