Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS Bootstrap Basics Responsive Layouts With the Bootstrap Grid Styling Content

PBCS Staff
PBCS Staff
8,522 Points

Why does mb-4 affect the top margin?

At about 1 minute in this lesson, the class mb-4 is added to the h3 elements. Clearly that will add a margin to the bottom. But when the display is refreshed, the h3 elements also shift down, implying the top margin was also changed. What's going on?

1 Answer

Steven Parker
Steven Parker
231,269 Points

The "mb-4" class only provides the bottom margin to the headers. But in the same step, the class "pt-4" was added to the "container" div, which is what provides the space at the top for all 3 columns.

This is done starting about 30 seconds in the video.