Program 3
Program 3
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Bootstrap Demo</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
rel="stylesheet">
</head>
<body>
<ul class="list-group">
</ul>
<h3 class="mt-4">Colors</h3>
<h3 class="mt-4">Buttons</h3>
</div>
<!-- Bootstrap JS (Optional, for certain components like dropdowns, modals, etc.) -->
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></
script>
</body>
</html>
Explanation
Sure, here's a breakdown of the HTML code provided and how it demonstrates Bootstrap 5.0
framework classes for Lists, Colors, and Bootstrap Buttons:
List Group:
The <ul> element with the class list-group is used to create a list group.
Each list item (<li>) within the list group has the class list-group-item, which styles the list items as
part of the list group.
Colors:
Each <div> has a combination of Bootstrap's color utility classes, such as bg-primary, bg-secondary,
etc., to set the background color.
Additionally, text-white class is added to ensure the text color contrasts well with the background
color.
Buttons:
Each button has the class btn, which is a general class for styling buttons in Bootstrap.
Each button also has a specific contextual class like btn-primary, btn-secondary, etc., to apply different
styles based on their purpose or importance.
The mr-2 class is used to add some margin to the right side of each button, ensuring proper spacing
between buttons.
Container:
The content is placed inside a <div> element with the class container to provide a responsive layout.
The mt-5 class adds top margin to provide spacing between the content and the top of the viewport.
Bootstrap CDN:
Bootstrap CSS and JavaScript files are linked from a Content Delivery Network (CDN) to ensure that
Bootstrap styles and functionality are applied to the page.
Overall, this HTML code provides a simple demonstration of how Bootstrap 5.0 framework classes can
be used to style lists, apply colors, and create buttons with various styles.