š Scenario: You are building a simple webpage to explain why Bootstrap is used in web development. This page will show a short list of reasons why Bootstrap exists and how it helps developers.
šÆ Goal: Create a clean, responsive webpage that lists the main reasons why Bootstrap exists, using semantic HTML and basic Bootstrap classes for styling.
š What You'll Learn
Use semantic HTML5 elements like <main> and <section>
Include a Bootstrap CSS link in the <head>
Create a list of reasons why Bootstrap exists inside a <section>
Use Bootstrap classes to style the list and make it responsive
Ensure the page has a header with a title
š” Why This Matters
š Real World
Bootstrap is widely used to quickly build responsive and visually consistent websites without writing all CSS from scratch.
š¼ Career
Knowing why Bootstrap exists helps you understand how to speed up web development and maintain design consistency, skills valuable for front-end developer roles.
Progress0 / 4 steps
1
Set up the basic HTML structure with Bootstrap CSS
Create a basic HTML5 page with lang="en" in the <html> tag. Add a <head> section with <meta charset="UTF-8">, a viewport meta tag for responsiveness, a <title> "Why Bootstrap Exists", and link the Bootstrap 5 CSS from the official CDN: https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css. Then add an empty <body> section.
Bootsrap
Hint
Remember to add the Bootstrap CSS link inside the <head> section using the <link> tag.
2
Add a header with a page title
Inside the <body>, add a <header> element with a Bootstrap class bg-primary and text-white for background and text color. Inside the header, add a <div> with class container and an <h1> with the text "Why Bootstrap Exists".
Bootsrap
Hint
Use Bootstrap classes bg-primary and text-white on the <header> to style the background and text color.
3
Add a main section with a list of reasons
Below the header, add a <main> element with a container class. Inside it, add a <section> with a heading <h2> "Reasons Bootstrap Exists". Then add an unordered list <ul> with Bootstrap class list-group. Add three list items <li> with class list-group-item containing these exact texts: "Makes responsive design easy", "Provides ready-to-use components", "Ensures consistent styling across browsers".
Bootsrap
Hint
Use Bootstrap's list-group and list-group-item classes to style the list nicely.
Use Bootstrap classes bg-light and text-center on the <footer> for a light background and centered text.
Practice
(1/5)
1. Why was Bootstrap created? Why Bootstrap exists
easy
A. To help build websites faster with ready-made styles
B. To replace HTML with a new language
C. To create desktop software applications
D. To make websites only for mobile phones
Solution
Step 1: Understand Bootstrap's purpose
Bootstrap provides pre-made styles and components to speed up website building.
Step 2: Compare options with Bootstrap's goal
Only To help build websites faster with ready-made styles matches the goal of faster website creation with styles.
Final Answer:
To help build websites faster with ready-made styles -> Option A
Quick Check:
Bootstrap speeds up styling = A [OK]
Hint: Bootstrap = faster styling and layout for websites [OK]
Common Mistakes:
Thinking Bootstrap replaces HTML
Believing Bootstrap is for desktop apps only
Assuming Bootstrap is only for mobile
2. Which is the correct way to include Bootstrap CSS in your HTML file?
easy
A.
B.
C.
D.
Solution
Step 1: Identify how CSS files are linked in HTML
CSS files are linked using the <link> tag with rel="stylesheet".
Step 2: Check options for correct syntax
Only uses the correct <link> tag for CSS.
Final Answer:
<link rel="stylesheet" href="bootstrap.css"> -> Option C
Quick Check:
CSS linked with <link> tag = C [OK]
Hint: CSS files use tag [OK]
Common Mistakes:
Using <script> tag for CSS
Using <style> tag with src attribute
Using <img> tag for CSS
3. What will this HTML code display in a browser?
<button class="btn btn-primary">Click Me</button>
medium
A. A plain button with default browser style
B. A blue styled button with padding and rounded corners
C. An error message because class names are wrong
D. A button with no text
Solution
Step 1: Understand Bootstrap button classes
The class "btn" styles the element as a button, and "btn-primary" adds a blue color with padding and rounded corners.
Step 2: Predict the visual output
The button will appear blue with nice padding and rounded edges, not plain or empty.
Final Answer:
A blue styled button with padding and rounded corners -> Option B
Quick Check:
btn-primary = blue styled button [OK]
Hint: "btn-primary" means blue styled button in Bootstrap [OK]
Common Mistakes:
Thinking it shows default browser button
Assuming class names cause errors
Expecting button with no text
4. This HTML uses Bootstrap classes but the styles are not applied. What is the likely problem?
<button class="btn btn-success">Save</button>
medium
A. Bootstrap CSS file is not linked in the HTML
B. The button tag is incorrect and should be <div>
C. Class names "btn" and "btn-success" are invalid
D. The button text "Save" is missing
Solution
Step 1: Check if Bootstrap CSS is linked
If Bootstrap CSS is missing, classes like "btn" and "btn-success" won't style the button.
Step 2: Verify other options
Button tag is correct, class names are valid, and text is present, so problem is missing CSS link.
Final Answer:
Bootstrap CSS file is not linked in the HTML -> Option A
Quick Check:
Missing CSS link = no styles applied [OK]
Hint: No styles? Check if Bootstrap CSS is linked [OK]
Common Mistakes:
Changing button tag unnecessarily
Thinking class names are wrong
Assuming button text is missing
5. You want your website to look good on phones, tablets, and desktops automatically. How does Bootstrap help with this?
hard
A. Bootstrap converts your HTML into a mobile app automatically
B. Bootstrap requires you to write separate code for each device
C. Bootstrap disables styles on small screens to save data
D. Bootstrap provides responsive grid and classes that adjust layout based on screen size
Solution
Step 1: Understand Bootstrap's responsive features
Bootstrap uses a grid system and responsive classes that change layout and styles depending on screen size.
Step 2: Evaluate options for correct explanation
Only Bootstrap provides responsive grid and classes that adjust layout based on screen size correctly describes Bootstrap's automatic adjustment for different devices.
Final Answer:
Bootstrap provides responsive grid and classes that adjust layout based on screen size -> Option D