Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap 100% width / Full width

I want to create a new website with Bootstrap and I need it to be 100% in width, but I do not want it to be fluid. At least not for now.

The issue I have is: using bootstrap standard limits you to 960px and with a fluid layout it is full width but behaves like a fluid layout should by moving elements to become stacked when the window is shrunk in size.

Is there a way to have 100% width with a static bootstrap layout?

like image 248
Somk Avatar asked Mar 04 '13 15:03

Somk


3 Answers

This is easy to achieve in Bootstrap 3, just replace the .container div with your own:

.my-fluid-container {
  padding-left: 15px;
  padding-right: 15px;
  margin-left: auto;
  margin-right: auto;
}

Thanks to Erik Flowers for the heads-up: http://www.helloerik.com/bootstrap-3-grid-introduction#fluid

UPDATE

Bootstrap 3 now offers a built-in fluid container class, just use <div class="container-fluid">. See docs.

like image 196
JP Lew Avatar answered Nov 16 '22 03:11

JP Lew


100% width ... static

This is a bit of an oxymoron. A 100% width layout isn't static.

Bootstrap uses a .container class to set a predefined width. Increase this to your desired page width if you want it to be greater than it's default. Be careful though that the sizing of Bootstrap's span* and offset* classes will need their widths adjusted accordingly.

like image 38
James Donnelly Avatar answered Nov 16 '22 04:11

James Donnelly


Just don't include the bootstrap-responsive.css in order to disable the responsive function.

If you don't want a .container gutter/margin you can put your content outside the container but keep in mind you must maintain your content layout by yourself(still can use grid but lost an ability to centering your content) and don't forget most of the Bootstrap component like .navbar need .container to control its width.

One of my work need a full screen carousel to holding all contents so I wrap my content with .container to center the content.

enter image description here

like image 24
lngs Avatar answered Nov 16 '22 02:11

lngs