Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Bootstrap 4 Card Text Alignment</title> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css"> <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.bundle.min.js"></script> <style> .bs-example{ margin: 20px; } </style> </head> <body> <div class="bs-example"> <!-- Card with default left text alignment --> <div class="card"> <div class="card-body"> <h5 class="card-title">Card title</h5> <p class="card-text">Lorem ipsum dolor sit amet tempor...</p> <a href="#" class="btn btn-primary">Know more</a> </div> </div> <!-- Card with center text alignment --> <div class="card text-center mt-3"> <div class="card-body"> <h5 class="card-title">Card title</h5> <p class="card-text">Vestibulum metus bibendum nibh sapien...</p> <a href="#" class="btn btn-primary">Know more</a> </div> </div> <!-- Card with right text alignment --> <div class="card text-right mt-3"> <div class="card-body"> <h5 class="card-title">Card title</h5> <p class="card-text">Pulvinar leo id risus pellentesque diam...</p> <a href="#" class="btn btn-primary">Know more</a> </div> </div> </div> </body> </html>