Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap - Card vs Container

I'm new to bootstrap and I came across examples for using cards and containers to contain other elements. Could someone please explain the difference and when to use them?

like image 724
Maddy Avatar asked Sep 12 '26 09:09

Maddy


1 Answers

My answer will explain the difference between cards and containers.

Containers

Containers are one of the most fundamental and basic bootstrap components. You use containers with their counterpart, rows, to create basic or complex content orientations in grids. Containers are for a websites layout. Documentation.

<div class='container'>

Cards

Cards, added in Bootstrap v4, define a way of displaying content. Try to visualize containers as content alignment and cards as content structure and design. Documentation.

<div class='card'>

Although cards are technically containers at their core, with a little more style, both have completely different intents.

like image 100
Lars Peterson Avatar answered Sep 15 '26 02:09

Lars Peterson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!