ercabq
Last Updated: February 25, 2016
·
17.31K
· sethrubenstein
57b36d3c9aeecb76cfed635080c8f327

Add padding to Bootstrap grid

I love Bootstrap, but the simple lack of padding in the spanX element makes it at times hard to work with if your content has a wrapper.

Thats a simple fix. Find the mixins.less file and find [class*="span"] and change it to...

[class*="span"] {
  float: left;
  min-height: 1px; // prevent collapsing columns
  .box-sizing(border-box);
  margin-left: @gridGutterWidth;
  padding-right: @gridGutterWidth;
}
.row [class*="span"]:first-of-type{
  padding-left: @gridGutterWidth;
}

Then in responsive-767px-max.less at [class="span"],
.row-fluid [class
="span"] add

padding-left: @gridGutterWidth;
Say Thanks
Respond

6 Responses
Add your response

3191
C1201849caa3693e9b41824351c9dc3d

Interesting!

over 1 year ago ·
3202
09d090b0e2441394922655e069548a32

But i dont have any .less file in my bootstrap download,only 4 .css files and 2 .js files.....

over 1 year ago ·
4045
Kerie avatar

@ramswaroop there're two versions of bootstrap stylesheets - CSS version and LESS css pre-processor - just check http://twitter.github.com/bootstrap/extend.html or bootstrap repo itself.

over 1 year ago ·
4249

Can you please just post or email me the modified bootstrap file. I have been unable to compile bootstrap from source.

over 1 year ago ·
4325
09d090b0e2441394922655e069548a32

@wikiziner yes, i got your point. Have already done it. Thanks for answering. Actually i was totally new to Bootstrap.

over 1 year ago ·
6365

Greetings,
I don't know how to compile LESS.
Is there any CSS version of this fix or can you send me an email?

Thank you!

over 1 year ago ·