question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Why doesn't Bootstrap columns have top/bottom padding?

See original GitHub issue

Just out of curiosity, why doesn’t Bootstrap include padding-top or padding-bottom on all of the column classes?

Surely it would be more consistent to add the same spacing across all column elements? Is this intentional? If so would someone be able to explain?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
rafalpcommented, Feb 27, 2019

If you nest columns inside column (perfectly valid use case when creating responsive site elements), you now have extra padding you need to remove. Same goes for using columns to lay out things inside other containers (eg. panels/cards/list groups).

In CSS it’s generally easier to add than to remove.

1reaction
mdocommented, Mar 2, 2019

The primary purpose of the grid system is to organize content horizontally—we’ve never had vertical padding on them by default in the 7+ years of the project. Usually the spacing is taken care of by the content within those columns.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spacing - Bootstrap
Assign responsive-friendly margin or padding values to an element or a subset of its sides with shorthand classes. Includes support for individual properties, ......
Read more >
Why is the padding between the bootstrap columns getting lost
Bootstrap does not add space between the columns, it adds space inside each column. So if you put another div inside each column...
Read more >
Bootstrap Padding - free examples & tutorial
Padding classes. Add padding values to an element or a subset of its sides using shortcode classes. Individual top, bottom, left, right as...
Read more >
UA Bootstrap - CSS - Arizona Digital
Columns create gutters (gaps between column content) via padding . That padding is offset in rows for the first and last column via...
Read more >
Why can't I add margin or padding to the top bottom of my a ...
The difference between Inline is, can you can see, it didn't push everybody else away. It plays well with others, it works in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found