Basic fluid grid HTML
Make any row "fluid" by changing .row
to .row
. The column classes stay the exact same, making it easy to flip between fixed and fluid grids.
<div class="row"> <div class="col-md-4">...</div> <div class="col-md-8">...</div></div>
Fluid offsetting
Operates the same way as the fixed grid system offsetting: add .offset*
to any column to offset by that many columns.
<div class="row"> <div class="col-md-4">...</div> <div class="col-md-4 offset2">...</div></div>
Fluid nesting
Fluid grids utilize nesting differently: each nested level of columns should add up to 12 columns. This is because the fluid grid uses percentages, not pixels, for setting widths.
<div class="row"> <div class="col-md-12"> Fluid 12 <div class="row"> <div class="col-md-6"> Fluid 6 <div class="row"> <div class="col-md-6">Fluid 6</div> <div class="col-md-6">Fluid 6</div> </div> </div> <div class="col-md-6">Fluid 6</div> </div> </div></div>
About responsive Bootstrap
Media queries allow for custom CSS based on a number of conditions—ratios, widths, display type, etc—but usually focuses around min-width
and max-width
.
- Modify the width of column in our grid
- Stack elements instead of float wherever necessary
- Resize headings and text to be more appropriate for devices
Use media queries responsibly and only as a start to your mobile audiences. For larger projects, do consider dedicated code bases and not layers of media queries.