Todayโs class was focused on Bootstrap Components, learning how to structure layouts and apply styles with Bootstrap utility classes.
w-0,w-25,w-50,w-75,w-100โ Controls width percentage.h-0,h-25,h-50,h-75,h-100โ Controls height percentage.
-
Columns are based on a 12-grid system.
-
Examples:
col-6โ Takes half width (6/12).col-3โ Takes quarter width (3/12).col-8โ Takes 8/12 of the row.
-
You can mix and match columns as long as they sum to 12 (or fewer).
Bootstrap Cards allow you to create structured content blocks.
Card Structure:
<div class="card">
<div class="card-body">
<h5 class="card-title">Card Title</h5>
<p class="card-text">Some quick example text to build on the card title.</p>
</div>
</div>Main Classes:
cardโ Wrapper for the card component.card-bodyโ Contains card content.card-titleโ Title of the card.card-textโ Regular text inside the card.
-
Create a Navbar at the top.
-
Include 5 National Symbols with Bootstrap cards.
- ๐ฎ๐ณ National Flag
- ๐ฆ National Bird (Peacock)
- ๐ National Animal (Tiger)
- ๐ณ National Tree / Ganga as National River
- ๐ชถ National Emblem (Lion Capital of Ashoka)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>National Symbols of India</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<!-- Navbar -->
<nav class="navbar navbar-dark bg-dark">
<div class="container-fluid">
<a class="navbar-brand" href="#">National Symbols of India</a>
</div>
</nav>
<div class="container mt-4">
<div class="row">
<!-- Example Card -->
<div class="col-4">
<div class="card">
<div class="card-body">
<h5 class="card-title">National Flag</h5>
<p class="card-text">The Tiranga is the national flag of India.</p>
</div>
</div>
</div>
<!-- Repeat for other symbols -->
</div>
</div>
</body>
</html>