unit 3 sol uiux
unit 3 sol uiux
1
IFETCE R- 2019A ACADEMIC YEAR: 2023-2024
2
IFETCE R- 2019A ACADEMIC YEAR: 2023-2024
</div>
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
17. How can you create a tabbed navigation menu?
To create a tabbed navigation menu using Bootstrap, you can utilize the nav and tab components.
<!DOCTYPE html>
<html>
<head>
<linkrel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
</head>
<body>
<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link active" href="#tab1">Tab 1</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#tab2">Tab 2</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#tab3">Tab 3</a>
</li>
</ul>
<div class="tab-content">
<div id="tab1" class="tab-pane fade show active">
<!-- Content for Tab 1 -->
</div>
<div id="tab2" class="tab-pane fade">
<!-- Content for Tab 2 -->
</div>
<div id="tab3" class="tab-pane fade">
<!-- Content for Tab 3 -->
</div>
</div>
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
21. In Bootstrap what are the two ways you can display the code?
In bootstrap you can display code in two ways
<code> tag : If you are going to display code inline, you should use <code> tag
3
IFETCE R- 2019A ACADEMIC YEAR: 2023-2024
<pre> tag: If you want to display the code as a standalone block element or it has multiple lines
then you should use <pre> tag.
4
IFETCE R- 2019A ACADEMIC YEAR: 2023-2024
PART-B
2. Create a web page using Bootstrap's CSS components for a travel booking website. The
page should include a hero section with a background image and text overlay, a card
section displaying popular travel destinations, and a contact form at the bottom.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Travel Booking Website</title>
5
IFETCE R- 2019A ACADEMIC YEAR: 2023-2024
<linkrel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
<style>
.hero-section {
background-image: url('path/to/hero-image.jpg');
background-size: cover;
background-position: center;
height: 400px;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
}
.hero-section h1 {
color: white;
font-size: 48px;
font-weight: bold;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
}
.card-section {
padding: 50px 0;
}
.contact-form {
background-color: #f4f4f4;
padding: 50px 0;
}
</style>
</head>
<body>
<section class="hero-section">
<h1>Plan Your Dream Vacation</h1>
</section>
<section class="card-section">
<div class="container">
<div class="row">
<div class="col-md-4">
<div class="card">
<img src="path/to/destination-1.jpg" class="card-img-top" alt="Destination 1">
<div class="card-body">
<h5 class="card-title">Destination 1</h5>
<p class="card-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<a href="#" class="btn btn-primary">Book Now</a>
</div>
</div>
</div>
<div class="col-md-4">
6
IFETCE R- 2019A ACADEMIC YEAR: 2023-2024
<div class="card">
<img src="path/to/destination-2.jpg" class="card-img-top" alt="Destination 2">
<div class="card-body">
<h5 class="card-title">Destination 2</h5>
<p class="card-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<a href="#" class="btn btn-primary">Book Now</a>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card">
<img src="path/to/destination-3.jpg" class="card-img-top" alt="Destination 3">
<div class="card-body">
<h5 class="card-title">Destination 3</h5>
<p class="card-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<a href="#" class="btn btn-primary">Book Now</a>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="contact-form">
<div class="container">
<div class="row">
<div class="col-md-6 offset-md-3">
<h2>Contact Us</h2>
<form>
<div class="mb-3">
4. Develop a responsive web page layout using Bootstrap's grid system for a fictional e-
commerce website. The layout should include a header, sidebar, main content area, and
footer. Additionally, demonstrate the responsiveness of the layout by adjusting the column
sizes for different screen sizes.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Responsive E-commerce Website</title>
<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
</head>
<body>
<header>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
7
IFETCE R- 2019A ACADEMIC YEAR: 2023-2024
<div class="container">
<a class="navbar-brand" href="#">E-commerce Website</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-
target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle
navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<a class="nav-link" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Products</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Contact</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="container mt-4">
<div class="row">
<div class="col-lg-3">
<div class="card">
<div class="card-body">
<h5 class="card-title">Sidebar</h5>
<p class="card-text">This is the sidebar content.</p>
</div>
</div>
</div>
<div class="col-lg-9">
<div class="card">
<div class="card-body">
<h5 class="card-title">Main Content</h5>
<p class="card-text">This is the main content area.</p>
</div>
</div>
</div>
</div>
</div>
8
IFETCE R- 2019A ACADEMIC YEAR: 2023-2024
9
IFETCE R- 2019A ACADEMIC YEAR: 2023-2024
<div class="carousel-caption">
<h3>Slide 1</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div>
</div>
<div class="carousel-item">
<img src="path/to/slide2.jpg" class="d-block w-100" alt="Slide 2">
<div class="carousel-caption">
<h3>Slide 2</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div>
</div>
<div class="carousel-item">
<img src="path/to/slide3.jpg" class="d-block w-100" alt="Slide 3">
<div class="carousel-caption">
<h3>Slide 3</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div>
</div>
</div>
<!-- Controls -->
<a class="carousel-control-prev" href="#carouselExample" role="button" data-bs-
slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExample" role="button" data-bs-
slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Next</span>
</a>
</div>
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
The provided HTML code demonstrates the implementation of a carousel in Bootstrap. Here's a
breakdown of the code:
The <div id="carouselExample" class="carousel slide" data-bs-ride="carousel"> element
sets up the carousel component. The data-bs-ride="carousel" attribute enables automatic
sliding of the carousel.
The <ol class="carousel-indicators"> element contains the indicators for each slide. Each
<li> element represents an indicator. The data-bs-target attribute specifies the target
carousel, and the data-bs-slide-to attribute specifies the index of the slide.
The <div class="carousel-inner"> element holds the carousel slides.
10
IFETCE R- 2019A ACADEMIC YEAR: 2023-2024
8. Develop a navigation menu and a fixed top navigation bar using Bootstrap for a
restaurant website. The navigation menu should include links to different sections of the
website, and the top navigation bar should display the restaurant's logo and contact
information.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Restaurant Website</title>
<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container">
<a class="navbar-brand" href="#">
<img src="path/to/logo.png" alt="Restaurant Logo" height="30">
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-
target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle
navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<a class="nav-link" href="#about">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#menu">Menu</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#gallery">Gallery</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#contact">Contact</a>
</li>
</ul>
</div>
</div>
</nav>
<header class="fixed-top">
<div class="container">
<div class="row">
11
IFETCE R- 2019A ACADEMIC YEAR: 2023-2024
<div class="col-lg-6">
<img src="path/to/logo.png" alt="Restaurant Logo" height="50">
</div>
<div class="col-lg-6 text-lg-end">
<p>Contact: 123-456-789 | [email protected]</p>
</div>
</div>
</div>
</header>
<!-- Rest of the website content -->
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
The provided HTML code demonstrates the implementation of a responsive navigation menu
and a fixed top navigation bar using Bootstrap for a restaurant website. Here's a breakdown of
the code:
The <nav class="navbar navbar-expand-lg navbar-light bg-light"> element sets up the
navigation menu. The navbar-expand-lg class ensures that the menu expands for large
screens. The navbar-light bg-light classes provide a light background color to the menu.
The <div class="container"> element wraps the navigation menu and provides a
container to align the content.
The restaurant's logo is placed within the <a class="navbar-brand" href="#"> element
using an <img> tag. Adjust the src attribute to the actual path of the logo image.
The navigation menu is collapsible using the Bootstrap navbar toggler. The data-bs-
toggle, data-bs-target, and aria-controls attributes control the collapsing behavior.
The <header class="fixed-top"> element creates a fixed top navigation bar. The fixed-top
class ensures that the navigation bar stays fixed
12