Playing the cards
Moving on, in our web application, we will create a new component containing the about information, named Card. We will take a break from page development to discuss this section in depth.
Cards are flexible container extensions that include internal options, such as header, footer, and other display options. In Bootstrap 4, there is a component called Card, but since we are supporting versions 3 and 4 in this book, we will teach both ways.
Learning cards in Bootstrap 4
As was mentioned before, Bootstrap 4 provides Cards components. To make use of them, create a div.card
element and start adding elements such as .card-block
and .card-img-top
:
<div class="card"> <img class="card-img-top img-responsive" src="imgs/landscape.jpg"> <div class="card-block"> <h4 class="card-title">Name</h4> <p class="card-text">About text</p> <a href="#" class="btn btn-primary">Can add buttons</a> </div> </div>
For...