<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Set Background and Borders to Bootstrap Containers</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"></script> </head> <body> <!-- Container with dark background and white text color --> <div class="container bg-dark text-white border py-3 my-3"> <h1>The heading</h1> <p>This content of paragraph.</p> </div> <!-- Container with light background --> <div class="container bg-light py-3 my-3"> <h1>The heading</h1> <p>This content of paragraph.</p> </div> <!-- Container with border --> <div class="container border py-3 my-3"> <h1>This is a heading</h1> <p>This content of paragraph.</p> </div> <p class="m-3"><strong>Note:</strong> The classes ".py-3", and ".my-3" are <a href="/twitter-bootstrap-tutorial/bootstrap-helper-classes.php" target="_top">Utility classes</a> for spaced elements out provide padding and 1 rem margins to the top and bottom of the element, accordingly.</p> </body> </html>