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 4 Basics (Retired) Using Bootstrap Components Displaying Content with Cards

Dongyun Cho
Dongyun Cho
2,256 Points

margin between cards?

There's a something like margin between cards in this video, but it seems that teacher didn't add any code for that. what makes that proper gaps??

Amin Ruhul
Amin Ruhul
Courses Plus Student 4,762 Points

It's bootsrap and it has some predefined class. if you use them then you will get predefined layout(design) with gap. for more. http://getbootstrap.com/css/#grid

2 Answers

To add a margin between "cards" (columns), add mt-x for every column.

<div class="col-md-6 col-lg-4 mt-5">
Karan Nahar
Karan Nahar
16,157 Points

Use card Columns.I have used it in the same class as the row. Margin is provided by card columns

    <div class="row card-columns">