Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I change Twitter Bootstrap grid widths?

I'm using Twitter Bootstrap right now ver 2.0 and notice that the space is not enough using the 12 column grid.

I think they're using 940px.. so how do I use a custom width without breaking the 12 column grid?

Thanks..

like image 469
Clannad System Avatar asked Apr 21 '12 15:04

Clannad System


2 Answers

The simplest way would be to customize your own download. Focus on the Grid section.

enter image description here

Alternatively you could edit the LESS or compiled CSS files directly.

like image 132
Terry Avatar answered Oct 20 '22 10:10

Terry


You can also create a new stylesheet (or add to an existing one) that simply overrides the values of those variables. This way you don't have to worry about bootstrap updates rewriting your changes. Just make sure you declare the variables after the bootstrap CSS and JS have loaded.

In fact, personally I think that's a better option otherwise you have to remember to re-edit the CSS file every time you install a bootstrap update and this is never a good idea.

This is especially problematic if you're using bootstrap as a gem (say for Rails). That's why I never like overwriting include files directly.

like image 45
kakubei Avatar answered Oct 20 '22 10:10

kakubei