Bootstrap 4 cards are a box container that contains by default padding. It has mainly three components namely .card-header
,.card-body
,.card-footer
.
.card-title
class is used to make heading inside the elements having class .card-header
.
.card-text
class is used to provide text information within child elements having class .card-body
.
.card-link
class is used to provide link inside the child element having class .card-body
.card-footer
.
Rose is the world one of the most beautiful flower that is the representation of love.
This bird stands on the tree and looking so cute dute to nature.
There are various languages used during web development.
Note:
In the above example, .card
,.card-header
,.card-body
& .card-link
classes are used to make simple bootstrap card.
Note: Bootstrap card is basically a rectangular box having by default padding. It is of two types namely horizontal card and vertical card.
Card background color can be achieved by applying bootstrap background color contextual classes.These classes are
.bg-primary
, .bg-info
,.bg-success
,.bg-danger
, .bg-warning
,.bg-dark
,.bg-light
,.bg-secondary
.
Primary card supports text information,images,link,list-group,navs etc.
Danger card supports text information,images,link,list-group,navs etc.
Success card supports text information,images,link,list-group,navs etc.
Info card supports text information,images,link,list-group,navs etc.
Light card supports text information,images,link,list-group,navs etc.
Dark card supports text information,images,link,list-group,navs etc.
secondary card supports text information,images,link,list-group,navs etc.
Bootstrap card can support text information,images,link,list-group,navs etc.
Note: In the above example,bootstrap background color utility classes are used to change the card background color.
Card border and card text color can be chnged by providing followings contextual class to the parent container that has class.card
.These contextual classes are .border-primary
,.border-secondary
,.border-success
,.border-danger
,.border-warning
,.border-info
,.border-light
,.border-dark
,.border-warning
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam eu sem tempor.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam eu sem tempor.
Note: Card border and card text color can be changed by card border utility claseses.
Bootstrap card parent container contains .card
while as immediate child contains .card-body
.Lets us see it by an example.
Note: In this example,.card
& .card-body
is used to make simplest card.
Bootstrap card parent container contains .card
while as child elements contains .card-body
and
.card-header
.Lets us see it by an example.
Note:
In this example,.card
, .card-body
& .card-header
is used to make simplest card with header component.
Bootstrap 4 card parent container contains .card
while as child elements contains .card-body
,
.card-header
and .card-footer
.Lets us see it by an example.
Note:
In this example,.card
, .card-body
,.card-header
& .card-footer
is used to make simplest card with header & footer.
Bootstrap 4 card parent container contains .card
while as child elements contains .card-body
,
.card-header
and .card-footer
.Please keep in mind that .card-title
can be used in
inside .card-header
and .card-footer
container..card-link
can be use inside .card-
body
and card-footer
container.Lets us see it with an example.
Write your card content now.
Note: In this example,.card
, .card-body
,.card-header
,.card-footer
& .card-link
is used to make simplest card with header , footer & card link.
To make whole card clickable,use .stretched-link
to the element having .card-link
.
Rose is the world one of the most beautiful flower that is the representation of love.
This bird stands on the tree and looking so cute dute to nature.
Write card content here.
Write your card content here.
Note: To create whole card clickable, assign .stretched-link
to the
card link having .card-link
.
To place image at the top of the card,use .card-img-top
to the <img>
base class.
Note:
To place image at the top of the card,assign .card-img-top
to the <img>
element base class.
To place an image into a card background ,use .card-img-overlay
.
Note:
To place the image in the background of the card,use .card-img-overlay
inside the card.
Bootstrap .card-columns
creates grid of card that might have different width and height of the card.It shows vertical card inside small device.
Note: Card column creates different width and height of the card and it shows vertical in smaller devices.
Bootstrap .card-deck
creates equal height and width of the card.
Note: Card-deck is a container of cards.It creates equal height and width of the card.
Card-group is basically a container of cards.It contains more than one cards.Bootstrap .card-group
removes left and right padding of each cards.
Note: Card-group is a container that consists of more than one card inside the card-group.
horizontal cards consists of image and text content and those are placed side-by-side using a combination of grid and utility classes.
Note: Bootstrap horizontal card consists of image and text content that lies horizontally left to right.