ShapeYourPath
(current)
Run Code
Live Code Editor- Bootstrap 5 Containers Background Color
Source Code
<!DOCTYPE html> <html lang="en"> <head> <!-- Required meta tags --> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="description" content=""> <!-- Bootstrap CSS --> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css" rel="stylesheet" /> <title>Bootstrap 5 Container Background Color</title> </head> <body> <div class="container text-center"> <h1>Bootstrap 5 Container Without Background Color</h1> <p>Container having no background color.</p> </div> <div class="container bg-light text-center mt-5 p-5"> <h1>Bootstrap 5 Container With Background Color</h1> <p>To add background color inside the container, use .bg-* class.</p> </div> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.bundle.min.js"></script> </body> </html>
Output :
Running