Can I or is not advised to change Bootstrap columns percentage to achieve different proportions. What I mean.
default
.col-lg-3 {
width: 25%;
}
.col-lg-9 {
width: 75%;
}
changing to
.col-lg-3 {
width: 20%;
}
.col-lg-9 {
width: 80%;
}
if so how and where do I change the less variables?
The
.col-X-3
= 20% and acol-X-12
(NOT -9) is a 15 column grid not 12. You can do two things:Go to the customizer (http://getbootstrap.com/customize/#grid-system)
And do this:
Then you will need to use different classes in your html since this is 100/15. You will see the new classes in the un-minified version of your download (at the bottom of the page).
If you use less, you would open up the variables.less locate the variable:
COPY THAT. Create your OWN custom-variables.less file, import that after the bootstrap variables.less file in your import file and change the value:
Then recompile with your application.
Otherwise, create your own columns in the min-width media query of your choice.
Less Variables of Twitter Bootstrap can be edited, compiled and downloaded here: http://getbootstrap.com/customize/#less-variables
However, I don't think you can change percentages of columns via width - only control the number of columns, gutter width, breakpoints, etc.
You can, however create another CSS file to override Bootstrap's grid and make your own. But be cautious in changing those percentages, as one column will affect others. For example, you may have changed .col-lg-3 and col-lg-9 and they fit together - however when you start using four .col-lg-3, they won't fit anymore.
What I usually do, when a section needs custom percentage columns, I put an ID then override the bootstrap column inside that specific section, so the default column percentages of bootstrap won't be affected on other parts of the website like so:
HTML:
CSS: