Complete the code to include the Bootstrap CSS file correctly 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 rel="stylesheet" href="[1]"> <title>Bootstrap Example</title> </head> <body> <h1 class="text-primary">Hello, Bootstrap!</h1> </body> </html>
rel="stylesheet" attribute.The Bootstrap CSS file must be linked in the <head> using the correct URL to apply styles.
Complete the code to create a responsive Bootstrap button with the primary color style.
<button type="button" class="btn [1]">Click me</button>
btn without a color class.The class btn-primary styles the button with Bootstrap's primary color.
Fix the error in the Bootstrap grid code by completing the missing class for a column that takes half the width on medium screens.
<div class="container"> <div class="row"> <div class="[1]"> Content here </div> </div> </div>
col-6 which applies to all screen sizes, not just medium.The class col-md-6 makes the column take half the width on medium screens and larger.
Fill both blanks to create a Bootstrap alert box with a close button that can be dismissed.
<div class="alert [1] alert-dismissible fade show" role="alert"> <strong>Warning!</strong> You should check this. <button type="button" class="btn-close" data-bs-dismiss="[2]" aria-label="Close"></button> </div>
data-bs-dismiss to a wrong value like modal.The alert box uses alert-warning for the yellow warning style, and the close button dismisses the alert component.
Fill all three blanks to create a Bootstrap navbar with a brand name, a toggle button, and a collapsible menu.
<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="#[3]" aria-controls="[3]" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse" id="navbarSupportedContent"> <ul class="navbar-nav me-auto mb-2 mb-lg-0"> <li class="nav-item"> <a class="nav-link active" aria-current="page" href="#">Home</a> </li> </ul> </div> </div> </nav>
dropdown instead of collapse.data-bs-target and the menu ID.The brand name is set to MySite. The toggle button uses collapse to toggle the menu with ID navbarSupportedContent.
