Complete the code to include the Bootstrap CSS link in the HTML head.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link href="[1]" rel="stylesheet"> <title>Bootstrap Example</title> </head> <body> <h1 class="text-primary">Hello, Bootstrap!</h1> </body> </html>
The correct Bootstrap CSS link is the official CDN URL to load Bootstrap styles.
Complete the code to add a responsive Bootstrap button with primary color.
<button type="button" class="btn [1]">Click me</button>
btn base class.The class btn-primary gives the button the primary blue color in Bootstrap.
Fix the error in the Bootstrap grid code to make columns responsive.
<div class="container"> <div class="row"> <div class="[1]">Column 1</div> <div class="col-md-6">Column 2</div> </div> </div>
Using col-md-6 for both columns ensures they share the row equally on medium screens and above.
Fill both blanks to create a Bootstrap card with a header and body text.
<div class="card" style="width: 18rem;"> <div class="[1]">Card Header</div> <div class="[2]">This is some text inside the card body.</div> </div>
card-footer instead of card-header for the header.card-title instead of card-body for the content.The card-header class styles the header area, and card-body styles the main content area of the card.
Fill all three blanks to create a responsive navbar with a brand name and toggle button.
<nav class="navbar navbar-expand-lg navbar-light bg-light"> <div class="container-fluid"> <a class="navbar-brand" href="#">[1]</a> <button class="navbar-toggler" type="button" data-bs-toggle="[2]" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation"> <span class="[3]"></span> </button> <div class="collapse navbar-collapse" id="navbarNav"> <ul class="navbar-nav"> <li class="nav-item"> <a class="nav-link active" aria-current="page" href="#">Home</a> </li> </ul> </div> </div> </nav>
The brand name is set as 'MySite'. The toggle button uses data-bs-toggle="collapse" to control the menu. The icon uses the class navbar-toggler-icon.
