This lesson is exclusive to members

Responsive Web Design Essentials - HTML5 CSS3 Bootstrap

How to put Bootstrap cards on one line using card groups decks & columns

Daniel Walter Scott

Download Exercise Files Download Completed Files



We’re awarding certificates for this course!

Check out the How to earn your certificate video for instructions on how to earn yours and click the available certificate levels below for more information.


I recommend hosting your new website with Bluehost, you can get a big discount by signing up with this link:

You need to be a member to view comments.

Join today. Cancel any time.

Sign Up
Hello there, we're going to take our cards that are all kind of stacked on top of each other, and make them side by side using Card Groups, Card Decks, and Card Columns. All right, let's do it. 

So our mock-up here has our cards side by side, but in our current version, when we dumped them all in earlier on, look, they're all kind of just on top of each other. So we could spend some time kind of messing about trying to flip them, or we could probably do D-Flex, remember, Display Flex, we used just in the last video, but let's have a little dig around in the documentation to see what we can do. And cards, under 'Components', 'Cards', have a lots of, like this is probably the longest one here on Bootstrap. Look, scrolling, scrolling, scrolling…

So I can understand when you're like, "Man, that's a lot to read through." Just read through it, there's lots of browsing that comes along, and in my case what I'm looking for is, I want to show you these kind of Card Layouts. So we'll look at Card Groups first. Basically if you add a card group, it's just applying the Display Flex, but in a particular kind of way, which is kind of grouping them all together, all on the same line. Let's give that a go. 

So it says wrap them all, there's our individual cards. Wrap them all up in this thing called a Card Group. So let's do that in VS code. Here's my cards, I'm going to grab them all; here we go. I'm going to go 'Command-Shift-P', start typing 'wrap'. Wrap with abbreviation, and I'm going to put in our dot, '.' then I'm going to put in 'card group'. You see, wraps it all up in this card group. Let's check to see what it does, and, jackpot, well kind of, they're all in the same line at least. 

So Card Groups seem to work, but if I go down a little bit further, there is different Card Groups. Look at this, it is a Card Deck. Now it has been pointed out in the past that the word deck for a Kiwi is probably misunderstood. So deck is what I'm trying to say, but if you're laughing, you're probably not the first. And just because it's funny, Google, or go to YouTube and check out New Zealand advert. Dick, spelt that way. It is PG, if you're an adult you'll think it's funny, it's not crude, not too crude. Anyway go check that out, pause it, come back. 

So if you've got it out of your system, so we're going to use the deck, and we're going to say Card Deck. I know. Let's have a look, look at that. The deck is what we want. It has got spaces next to it, there's a nice one. Let's have a look at what else you can do. So let's have a look, some other things. There's Card Columns, we're not going to do columns but you could see, this is kind of cool, right? They're all kind of stacked on top of each other, different sizes. 

That would have been good for-- remember this one we did earlier? At the moment they're all the same size, but let's say my design was all kind of like jagged and up and down. I can see how that would be super cool, using the kind of, what is it? Card Columns. 

All right, so that's Card Groups, Card D-E-C-Ks, and Card Columns. Let's get into the next video.