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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With