Program 8
Program 8
Program:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bootstrap 5 Nav and Footer Example</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
rel="stylesheet">
<script
src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"></
script>
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"></script>
</head>
<body>
</body>
</html>
Explanation:
Head Section
1. Meta Tags:
o <meta charset="UTF-8">: Sets the character encoding for the document to
UTF-8.
o <meta name="viewport" content="width=device-width, initial-
scale=1.0">: Ensures proper scaling and rendering on mobile devices.
2. Title:
o <title>Bootstrap 5 Nav and Footer Example</title>: Sets the title of the
webpage.
3. Bootstrap CSS:
o <link
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootst
rap.min.css" rel="stylesheet">: Includes the Bootstrap 5.0 CSS for styling.
4. Bootstrap JS and Popper.js:
o <script
src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/po
pper.min.js"></script>: Includes Popper.js required for Bootstrap tooltips and
popovers.
o <script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstra
p.min.js"></script>: Includes the Bootstrap 5.0 JavaScript for interactive
components.
Body Section
Navigation Bar
Nav Container:
Collapsible Content:
o <div class="collapse navbar-collapse" id="navbarNav">: Contains the
collapsible content of the navbar.
o <ul class="navbar-nav">: Defines a list of navigation items.
o Each <li class="nav-item"> contains a navigation link (<a class="nav-
link" href="#">).
Main Content
Container:
<div class="container mt-5">: A Bootstrap container to center and add spacing (mt-
5 for margin-top).
<h1 class="text-center">: A centered heading.
<p class="text-center">: A centered paragraph.
Footer
Footer Container:
This layout demonstrates how to use Bootstrap 5.0 to create a responsive navigation bar and
footer with multiple sections and links.