Mehakwdfile
Mehakwdfile
#Objective
The objective of this experiment is to create a Home Page for Book Store Website
with NavBar and a SideBar.
.main-content h1 {
color: #e0e0e0; /* Light header text */
font-size: 2rem;
margin-top: 0;
}
.main-content p {
font-size: 1.1rem;
line-height: 1.6;
color: #bbb; text-align: center;
}
.main-content img {
width: 100%;
border-radius: 10px;
margin: 20px 0;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}
/* Footer */
footer {
text-align: center;
padding: 15px;
background-color: #1f1f1f; /* Dark footer */
color: #fff;
font-size: 0.9rem;
}
nav{margin-left: 950px;}
</style>
</head>
<body>
<header>
<div class="logo-container">
<img src="https://encrypted-tbn0.gstatic.com/images?
q=tbn:ANd9GcTAA_yCHeOkOvqO_38Ad1I7A5pmPYuqIF4u7g&s" alt="College Logo"
class="logo">
<div class="college-name">Inderprastha Engineering College
Bookstore</div>
</div>
<nav>
<a href="index.html">Home</a>
<a href="login.html">Login</a>
<a href="registration.html">Registration</a>
<a href="catalogue.html">Catalogue</a>
<a href="cart.html">Cart</a>
</nav>
</header>
<div class="main-container">
<aside class="sidebar">
<h3>Engineering Subjects</h3>
<ul>
<li><a href="bookstore1.html">Computer Science</a></li>
<li><a href="bookstore2.html">Electrical Engineering</a></li>
<li><a href="bookstore3.html">Mechanical Engineering</a></li>
<li><a href="bookstore4.html">Civil Engineering</a></li>
</ul>
</aside>
<div class="content">
<section class="welcome-section">
<div class="main-content">
<h1>Welcome to Inderprastha Engineering College</h1>
<p>
We are committed to delivering quality education in engineering
and technology. Our college offers
specialized programs and books in Computer Science,
Electronics, Electrical, and Civil Engineering.
Explore the website for resources, course registration, and
access to your cart.
</p>
<img
src="https://images.shiksha.com/mediadata/images/1578908939phpNDDJTh.jp
eg" alt="Campus View">
</div>
</div>
#Objective
The objective of this experiment is to create a Login Page for Book Store Website
with NavBar and a SideBar.
<div class="main-container">
<aside class="sidebar">
<h3>Engineering Subjects</h3>
<ul>
<li><a href="bookstore1.html">Computer Science</a></li>
<li><a href="bookstore2.html">Electrical Engineering</a></li>
<li><a href="bookstore3.html">Mechanical Engineering</a></li>
<li><a href="bookstore4.html">Civil Engineering</a></li>
</ul>
</aside>
<div class="content">
<form class="login-form">
<h2>Login</h2>
<label for="username">Username:</label>
<input type="text" id="username" name="username" required>
<label for="password">Password:</label>
<input type="password" id="password" name="password" required>
<button type="submit">Login</button>
#Output
Experiment 03: Make a Registration Page For Bookstore
Website
#Objective
The objective of this experiment is to create a Registration Page for Book Store
Website with NavBar and a SideBar.
#Output
Experiment 04: Make a Catalogue Page For Bookstore
Website
#Objective
The objective of this experiment is to create a Catalogue Page for Book Store
Website with NavBar and a SideBar.
<!DOCTYPE html>
<html lang="en">
<head>
<style>
body {
font-family: 'Georgia', serif;
background-color: white; /* Dark background */
margin: 0;
padding: 0;
color: black; /* Light text color */
}
header {
background-color: #3e497a; /* Keep the header color */
color: white;
padding: 15px;
text-align: center;
}
header h1 {
margin: 0;
font-size: 28px;
font-weight: bold;
}
.book-container {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
gap: 20px;
padding: 20px;
max-width: 1200px;
margin: auto;
}
.book-item {
background-color: grey; /* Dark background for book items */
border-radius: 10px;
box-shadow: 0 4px 8px rgb(246, 246, 246); /* Darker shadow */
overflow: hidden;
text-align: center;
padding: 15px;
transition: transform 0.3s;
}
.book-item:hover {
transform: translateY(-5px);
}
.book-item img {
width: 100px;
height: 130px;
object-fit: cover;
margin-bottom: 10px;
}
.book-title {
font-size: 18px;
font-weight: bold;
color: #ffb319; /* Lighter color for titles */
margin: 10px 0 5px;
}
.book-author {
font-size: 16px;
color: #cccccc; /* Light gray for authors */
margin: 5px 0;
}
.book-price {
font-size: 18px;
color: #b12704; /* Price color */
font-weight: bold;
margin: 5px 0;
}
.add-to-cart {
background-color: #ffb319; /* Button background color */
color: white;
border: none;
padding: 10px 20px;
border-radius: 5px;
cursor: pointer;
font-weight: bold;
transition: background-color 0.3s;
}
.add-to-cart:hover {
background-color: #e6a000; /* Darker button on hover */
}
footer {
text-align: center;
padding: 10px;
background-color: #3e497a; /* Keep the footer color */
color: white;
position: fixed;
width: 100%;
bottom: 0;
font-size: 14px;
}
</style>
</head>
<body>
<header>
<h1>CSE Books for B.Tech Students</h1>
</header>
<div class="book-container">
<!-- Book 1 -->
<div class="book-item">
<img
src="https://m.media-amazon.com/images/I/71wPDFZZu4L._AC_UF1000,1000_QL80_
.jpg" alt="Introduction to Algorithms">
<p class="book-title">Introduction to Algorithms</p>
<p class="book-author">by Mr Ipec pascal</p>
<p class="book-price">₹250</p>
<button class="add-to-cart" onclick="addToCart('Introduction to Algorithms',
'Mr Ipec pascal', 89.99)">Add to Cart</button>
</div>
</div>
</div>
<!-- Book 6 -->
<div class="book-item">
<img
src="https://images.routledge.com/common/jackets/crclarge/978084932/978084932
6912.jpg" alt="Database System Concepts">
<p class="book-title">Database System Concepts</p>
<p class="book-author">by Mr Ipec pascal</p>
<p class="book-price">₹599</p>
<button class="add-to-cart" onclick="addToCart('Database System
Concepts', 'Mr Ipec pascal', 89.99)">Add to Cart</button>
</div>
<!-- Repeat for other books -->
</div>
<footer>
© 2024 College Bookstore. All rights reserved.
</footer>
<script>
function addToCart(title, author, price) {
// Get existing cart data from localStorage
let cart = JSON.parse(localStorage.getItem('cart')) || [];
Bookstore2:
<!DOCTYPE html>
<html lang="en">
<head>
<style>
body {
font-family: 'Georgia', serif;
background-color: white; /* Dark background */
margin: 0;
padding: 0;
color: black; /* Light text color */
}
header {
background-color: #3e497a; /* Keep the header color */
color: white;
padding: 15px;
text-align: center;
}
header h1 {
margin: 0;
font-size: 28px;
font-weight: bold;
}
.book-container {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
gap: 20px;
padding: 20px;
max-width: 1200px;
margin: auto;
}
.book-item {
background-color: grey; /* Dark background for book items */
border-radius: 10px;
box-shadow: 0 4px 8px rgb(246, 246, 246); /* Darker shadow */
overflow: hidden;
text-align: center;
padding: 15px;
transition: transform 0.3s;
}
.book-item:hover {
transform: translateY(-5px);
}
.book-item img {
width: 100px;
height: 130px;
object-fit: cover;
margin-bottom: 10px;
}
.book-title {
font-size: 18px;
font-weight: bold;
color: #ffb319; /* Lighter color for titles */
margin: 10px 0 5px;
}
.book-author {
font-size: 16px;
color: #cccccc; /* Light gray for authors */
margin: 5px 0;
}
.book-price {
font-size: 18px;
color: #b12704; /* Price color */
font-weight: bold;
margin: 5px 0;
}
.add-to-cart {
background-color: #ffb319; /* Button background color */
color: white;
border: none;
padding: 10px 20px;
border-radius: 5px;
cursor: pointer;
font-weight: bold;
transition: background-color 0.3s;
}
.add-to-cart:hover {
background-color: #e6a000; /* Darker button on hover */
}
footer {
text-align: center;
padding: 10px;
background-color: #3e497a; /* Keep the footer color */
color: white;
position: fixed;
width: 100%;
bottom: 0;
font-size: 14px;
}
</style>
</head>
<body>
<header>
<h1>ECE Books for B.Tech Students</h1>
</header>
<div class="book-container">
<!-- Book 1 -->
<div class="book-item">
<img src="https://static.pw.live/5eb393ee95fab7468a79d189/509b850b-
9116-4cd3-846d-86846632a8a7.png" alt="Electronic Devices and Circuit Theory">
<p class="book-title">Electronic Devices and Circuit Theory</p>
<p class="book-author">Mr Ipec pascal</p>
<p class="book-price">₹450</p>
<button class="add-to-cart" onclick="addToCart('Electronic Devices and
Circuit Theory', 'Mr Ipec pascal', 89.99)">Add to Cart</button>
</div>
<footer>
© 2024 College Bookstore. All rights reserved.
</footer>
<script>
function addToCart(title, author, price) {
// Get existing cart data from localStorage
let cart = JSON.parse(localStorage.getItem('cart')) || [];
</body>
</html>
Bookstore3:
<!DOCTYPE html>
<html lang="en">
<head>
<style>
body {
font-family: 'Georgia', serif;
background-color: white; /* Dark background */
margin: 0;
padding: 0;
color: black; /* Light text color */
}
header {
background-color: #3e497a; /* Keep the header color */
color: white;
padding: 15px;
text-align: center;
}
header h1 {
margin: 0;
font-size: 28px;
font-weight: bold;
}
.book-container {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
gap: 20px;
padding: 20px;
max-width: 1200px;
margin: auto;
}
.book-item {
background-color: grey; /* Dark background for book items */
border-radius: 10px;
box-shadow: 0 4px 8px rgb(246, 246, 246); /* Darker shadow */
overflow: hidden;
text-align: center;
padding: 15px;
transition: transform 0.3s;
}
.book-item:hover {
transform: translateY(-5px);
}
.book-item img {
width: 100px;
height: 130px;
object-fit: cover;
margin-bottom: 10px;
}
.book-title {
font-size: 18px;
font-weight: bold;
color: #ffb319; /* Lighter color for titles */
margin: 10px 0 5px;
}
.book-author {
font-size: 16px;
color: #cccccc; /* Light gray for authors */
margin: 5px 0;
}
.book-price {
font-size: 18px;
color: #b12704; /* Price color */
font-weight: bold;
margin: 5px 0;
}
.add-to-cart {
background-color: #ffb319; /* Button background color */
color: white;
border: none;
padding: 10px 20px;
border-radius: 5px;
cursor: pointer;
font-weight: bold;
transition: background-color 0.3s;
}
.add-to-cart:hover {
background-color: #e6a000; /* Darker button on hover */
}
footer {
text-align: center;
padding: 10px;
background-color: #3e497a; /* Keep the footer color */
color: white;
position: fixed;
width: 100%;
bottom: 0;
font-size: 14px;
}
</style>
</head>
<body>
<header>
<h1>Mechanical Engineering Books for B.Tech Students</h1>
</header>
<div class="book-container">
<!-- Book 1 -->
<div class="book-item">
<img
src="https://madeeasypublications.org/images/book/9789362027344/978936202734
4_large.png" alt="Structural Analysis">
<p class="book-title">Structural Analysis</p>
<p class="book-author">by Jo Bhi Tha Maar Gya</p>
<p class="book-price">₹200</p>
<button class="add-to-cart" onclick="addToCart('Structural Analysis', 'Mr
Ipec pascal', 89.99)">Add to Cart</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<footer>
© 2024 College Bookstore. All rights reserved.
</footer>
<script>
function addToCart(title, author, price) {
// Get existing cart data from localStorage
let cart = JSON.parse(localStorage.getItem('cart')) || [];
</body>
</html>
Bookstore4:
<!DOCTYPE html>
<html lang="en">
<head>
<style>
body {
font-family: 'Georgia', serif;
background-color: white; /* Dark background */
margin: 0;
padding: 0;
color: black; /* Light text color */
}
header {
background-color: #3e497a; /* Keep the header color */
color: white;
padding: 15px;
text-align: center;
}
header h1 {
margin: 0;
font-size: 28px;
font-weight: bold;
}
.book-container {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
gap: 20px;
padding: 20px;
max-width: 1200px;
margin: auto;
}
.book-item {
background-color: grey; /* Dark background for book items */
border-radius: 10px;
box-shadow: 0 4px 8px rgb(246, 246, 246); /* Darker shadow */
overflow: hidden;
text-align: center;
padding: 15px;
transition: transform 0.3s;
}
.book-item:hover {
transform: translateY(-5px);
}
.book-item img {
width: 100px;
height: 130px;
object-fit: cover;
margin-bottom: 10px;
}
.book-title {
font-size: 18px;
font-weight: bold;
color: #ffb319; /* Lighter color for titles */
margin: 10px 0 5px;
}
.book-author {
font-size: 16px;
color: #cccccc; /* Light gray for authors */
margin: 5px 0;
}
.book-price {
font-size: 18px;
color: #b12704; /* Price color */
font-weight: bold;
margin: 5px 0;
}
.add-to-cart {
background-color: #ffb319; /* Button background color */
color: white;
border: none;
padding: 10px 20px;
border-radius: 5px;
cursor: pointer;
font-weight: bold;
transition: background-color 0.3s;
}
.add-to-cart:hover {
background-color: #e6a000; /* Darker button on hover */
}
footer {
text-align: center;
padding: 10px;
background-color: #3e497a; /* Keep the footer color */
color: white;
position: fixed;
width: 100%;
bottom: 0;
font-size: 14px;
}
</style>
</head>
<body>
<header>
<h1>Civil Engineering Books for B.Tech Students</h1>
</header>
<div class="book-container">
<!-- Book 1 -->
<div class="book-item">
<img
src="https://m.media-amazon.com/images/I/41yhiGjykLL._UF1000,1000_QL80_.jpg"
alt="Structural Analysis">
<p class="book-title">Structural Analysis</p>
<p class="book-author">by Jo Bhi Tha Maar Gya</p>
<p class="book-price">₹200</p>
<button class="add-to-cart" onclick="addToCart('Structural Analysis', 'Mr
Ipec pascal', 89.99)">Add to Cart</button>
</div>
</div>
</div>
</div>
</div>
</div>
<footer>
© 2024 College Bookstore. All rights reserved.
</footer>
<script>
function addToCart(title, author, price) {
// Get existing cart data from localStorage
let cart = JSON.parse(localStorage.getItem('cart')) || [];
</body>
</html>
#Output[catalogue]
Experiment 05: Make a cart Page For Bookstore Website
#Objective
The objective of this experiment is to create a cart Page for Book Store Website
with NavBar and a SideBar.
<div class="main-container">
<aside class="sidebar">
<h3>Engineering Subjects</h3>
<ul>
<li><a href="bookstore1.html">Computer Science</a></li>
<li><a href="bookstore2.html">Electrical Engineering</a></li>
<li><a href="bookstore3.html">Mechanical Engineering</a></li>
<li><a href="bookstore4.html">Civil Engineering</a></li>
</ul>
</aside>
</div>
<center><a href="shopping page.html" target="main">Cart</a>
</center>
</body>
</html>
#shopping page:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
table
{
border: 80%;margin-top: -38rem;margin-right: 20rem;
}
body
{
background-color: white;
}
td
{
border-top: none;
border-bottom: none;
}
</style>
</head>
<body>
<table align="center" cellpadding="30" cellspacing="0" border="black">
<tr>
<th>Sr no.</th>
<th>Book Name</th>
<th>Price</th>
<th>Quantity</th>
<th>Amount</th>
</tr>
<tr>
<td>1</td>
<td>Java 2</td>
<td>$35.5</td>
<td>2</td>
<td>$70</td>
</tr>
<tr>
<td>2</td>
<td>XML</td>
<td>$40.5</td>
<td>1</td>
<td>$40.5</td>
</tr>
<tr>
<th colspan="3">Total Amount</th>
<th colspan="2">$130.5</th>
</tr>
</table>
</body>
</html>
#Output
Experiment 6: Name & Password Validation Using JS
#Objective
Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Registration Page</title>
<style>
.error { color: red;
font-size: 14px;
}
form {
max-width: 400px; margin: auto;
}
input {
display: block; margin: 10px 0; padding: 10px; width: 100%;
}
button {
padding: 10px 20px; font-size: 16px; cursor: pointer;
}
span {
margin-top: 10px;
}
</style>
</head>
<body>
<center>
<h1>Registration Page</h1>
</center>
<form id="registrationForm">
<label for="name">Name:</label>
<input type="text" id="name" name="name" />
<span class="error" id="nameError"></span>
<br>
<label for="password">Password:</label>
<input type="password" id="password" name="password" />
<span class="error" id="passwordError"></span>
<br />
<button type="submit">Register</button>
</form>
<script> document
.getElementById("registrationForm")
.addEventListener("submit", function (e) { e.preventDefault();
const name = document.getElementById("name").value.trim();
const password = document.getElementById("password").value.trim();
if (isValid) {
alert("Registration successful!");
}
});
</script>
</body>
</html>
Output [ With Correct Fields]
#Objective
Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Registration Page</title>
<script>
function validateForm() {
// Get input values
var email = document.getElementById('email').value;
var phoneNumber = document.getElementById('phone').value;
// Validate Email
if (!validateEmail(email)) {
alert('Invalid email address. Please enter a valid email.');
return false;
}
// Validate Phone Number
if (!validatePhoneNumber(phoneNumber)) {
alert('Phone number should contain 10 digits only.');
return false;
}
// Form is valid
alert('Registration successful!');
return true;
}
function validateEmail(email) {
// Check if the email follows the standard pattern
var regex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
return regex.test(email);
}
function validatePhoneNumber(phoneNumber) {
// Check if the phone number contains exactly 10 digits
var regex = /^\d{10}$/;
return regex.test(phoneNumber);
}
</script>
<style>
body{
background-color:pink;
text-align: center;
margin-top: 150px;
}
</style>
</head>
<body>
<form onsubmit="return validateForm()">
<label for="email">Email:</label>
<input type="email" id="email" name="email" required>
<br><br>
<label for="phone">Phone Number:</label>
<input type="tel" id="phone" name="phone" required>
<br><br>
<input type="submit" value="Register">
</form>
</body>
</html>
#Objective
Design a web page using CSS which includes the following:
1) Use different font, styles: In the style definition you define how each selector
should work(font, color etc.). Then, in the body of your pages, you refer to
these selectors to activate the styles.
2) Set a background image for both the page and single elements on the page
Code:
header h1 {
font-size: 2.5em;
text-align: center;
margin-top:
20px;
}
header .subtitle
{ font-style:
italic; font-
weight: 300;
text-align:
center; margin-
top: 5px;
}
main {
max-width: 800px;
margin: 0 auto;
padding: 20px;
border-radius:
10px;
}
main .content h2
{ font-size:
1.8em;
margin-bottom: 10px;
}
main .content p {
font-size:
1em; line-
height: 1.6;
padding: 0 20px;
}
ul {
list-style-type: none;
padding-left: 0;
}
li {
margin-bottom:
10px; padding-left:
20px; position:
relative;
}
li::before
{ content: '>';
position: absolute;
left: 0;
font-family: monospace;
font-weight: bold;
}
footer {
text-align: center;
margin-top: 30px;
padding: 20px;
border-radius:
10px;
}
footer p {
margin-bottom: 10px;
}
a{
text-decoration: none;
font-weight: bold;
}
body.page1 header h1
{ color: #4fc3f7;
}
body.page1 main {
background-color: rgba(33, 33, 33, 0.8);
}
body.page1 a
{ color:
#4fc3f7;
}
body.page1 a:hover
{ color: #81d4fa;
}
body.page1 li::before
{ color: #4fc3f7;
}
body.page1 footer {
background-color: rgba(25, 25, 25, 0.8);
}
body.page2 header h1
{ color: #1976d2;
}
body.page2 main {
background-color: rgba(255, 255, 255, 0.8);
}
body.page2 a
{ color:
#1976d2;
}
body.page2 a:hover
{ color: #1565c0;
}
body.page2 li::before
{ color: #1976d2;
}
body.page2 footer {
background-color: rgba(240, 240, 240, 0.8);
}
#Objective
The objective of this experiment is to create web pages that control the repetition
of the image with the background-repeat property.
Code:
<!-- Space.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Background Repeat - repeat</title>
<style>
body
{ margin
: 0;
padding: 0;
height:
100vh;
background-image:
url("https://cdn.vectorstock.com/i/1000x1000/76/13/colorful-square-blank-background-design- vector-
4007613.webp");
background-repeat: space;
background-size: 100px 100px;
background-color: #f0f8ff;
font-family: "Arial", sans-serif;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
color: #333;
}
.container
{ padding: 20px;
background-color: rgb(255, 255, 255);
border-radius: 8px;
}
h1 {
color: #085454;
}
p{
color: #555;
}
</style>
</head>
<body>
<div class="container">
<h1>Background Repeat: Space</h1>
<p>
The image repeats both horizontally and vertically to fill the page.
</p>
</div>
</body>
</html>
<!-- RepeatX.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Background Repeat - repeat</title>
<style>
body
{ margin
: 0;
padding: 0;
height:
100vh;
background-image:
url("https://cdn.vectorstock.com/i/1000x1000/76/13/colorful-square-blank-background-design- vector-
4007613.webp");
background-repeat: repeat-x;
background-size: 100px 100px;
background-color: #f0f8ff;
font-family: "Arial", sans-serif;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
color: #333;
}
.container
{ padding: 20px;
background-color: rgb(255, 255, 255);
border-radius: 8px;
}
h1 {
color: #085454;
}
p{
color: #555;
}
</style>
</head>
<body>
<div class="container">
<h1>Background Repeat: Repeat X</h1>
<p>The image repeats horizontally to fill the page.</p>
</div>
</body>
</html>
Output [ Space.html ]
Output [ RepeatX.html ]
Output [ RepeatY.html ]
Output [ NoRepeat.html ]
Output [ Round.html ]
#Objective
The objective of this experiment is to create web pages that define styles
for links as A:link A:visited A:active A:hover
Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>College Website</title>
<style>
body {
font-family: 'Lato', sans-serif;
font-size: 16px;
margin: 0;
padding: 0;
background-image: url('https://img.freepik.com/free-photo/ultra-detailed-nebula-
abstract-wallpaper-4_1562-749.jpg?
t=st=1733661073~exp=1733664673~hmac=e91fafc18101059457cfdddb59877300b
12681b808468e7c7921ad95e2c61ceb&w=996');
background-size: cover;
background-repeat: no-repeat;
background-color: #0000004d;
min-height: 100vh;
display: flex;
flex-direction: column;
}
.wrapper {
flex: 1;
}
header {
background-color: #333;
color: #fff;
text-align: center;
padding: 30px;
border-bottom: 2px solid #fff;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}
27.h1 {
font-family: 'Roboto', sans-serif;
font-size: 36px;
margin: 0;
}
nav ul {
list-style-type: none;
margin: 20px 0 0;
padding: 0;
}
nav li {
display: inline-block;
margin-right: 40px;
}
nav a {
color: #fff;
text-decoration: none;
font-weight: bold;
transition: color 0.3s ease;
}
nav a:hover {
color: orchid;
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}
nav a:active{
color: red;
}
.btn:visited{
color: green;
}
.abc:link{
color: bisque;
}
.main-content {
max-width: 800px;
margin: 80px auto;
padding: 40px;
background-color: rgba(255, 255, 255, 0.8);
border-radius: 5px;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}
</style>
</head>
<body>
<header>
<nav>
<ul>
<li><a href="#" class="abc">Home</a></li>
<li><a href="#">Courses</a></li>
<li><a href="#">Admissions</a></li>
<li><a href="#">Academics</a></li>
<li><a href="#">Placement</a></li>
<li><a href="#">About Us</a></li>
</ul>
</nav>
</header>
<section class="main-content">
<h2>Welcome to Our College Website</h2>
<p>Explore the opportunities and academic programs we offer.</p>
<a href="#" class="btn">Learn More</a>
</section>
</body>
</html>
#Output
Experiment 10: Resume Using HTML Table and List Tags
Objective
Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Simple Resume</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 20px;
background-color: #f4f4f4;
}
.resume {
border: 2px solid #333;
padding: 20px;
background-color: #fff;
max-width: 600px;
margin: auto;
}
.section {
margin: 20px 0;
}
table {
width: 100%;
border-collapse: collapse;
}
th, td {
border: 1px solid #333;
padding: 8px;
text-align: left;
}
th {
background-color: #e7f3fe;
}
h1, h2, h3 {
margin: 0;
}
</style>
</head>
<body>
<div class="resume">
<center><h1>RESUME</h1>
<h2>Nikhil Sharma</h2>
<img src="https://cdn.pixabay.com/photo/2015/10/05/22/37/blank-profile-picture-
973460_1280.png" width="150" align="right">
<h3>CONTACT INFORMATION</h3></center>
<p>Email: [email protected]</p>
<p>Phone: +91 98**993939</p>
<p>LinkedIn: <linkedin class="com">
<in>
<div class="section">
<center><h2>Education</h2></center>
<table>
<tr>
<th>class</th>
<th>Institution</th>
<th>Year</th>
</tr>
<tr>
<td>10th</td>
<td>SR Capital Public School</td>
<td>2020</td>
</tr>
<tr>
<td>12th</td>
<td>DAV SR. Secondary School</td>
<td>2022</td>
</tr>
<tr>
<td> BTECH CSE</td>
<td>IPEC</td>
<td>2023-2027</td>
</tr>
</table>
</table>
</div>
<div class="section">
<center><h2>Work Experience</h2>
<H1>Professional Summary</H1></center>
<p>Results-driven professional with over 5 years of experience in software
development and project management. Proven track record of delivering high-quality
software solutions on time and within budget</p>
<center><h3>Intern</h3></center>
<p>CODE ALPHA,Elite TEC INTERN</p>
<p>Assisted in software development and participated in team meetings.</p>
</div>
<div class="section">
<Center><h2>Skills</h2></Center>
<ul>
<li>Programming Languages: Python, Java, JavaScript</li>
<li>Web Development: HTML, CSS, React</li>
<li>Database Management: SQL, MongoDB</li>
</ul>
</div>
</div>
</body>
</html>
Experiment 11: Calculator Using Java Script
#Objective
Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Calculator in HTML CSS & JavaScript</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div class="container">
<input type="text" class="display" />
<div class="buttons">
<button class="operator" data-value="AC">AC</button>
<button class="operator" data-value="DEL">DEL</button>
<button class="operator" data-value="%">%</button>
<button class="operator" data-value="/">/</button>
<button data-value="7">7</button>
<button data-value="8">8</button>
<button data-value="9">9</button>
<button class="operator" data-value="*">*</button>
<button data-value="4">4</button>
<button data-value="5">5</button>
<button data-value="6">6</button>
<button class="operator" data-value="-">-</button>
<button data-value="1">1</button>
<button data-value="2">2</button>
<button data-value="3">3</button>
<button class="operator" data-value="+">+</button>
<button data-value="0">0</button>
<button data-value="00">00</button>
<button data-value=".">.</button>
<button class="operator" data-value="=">=</button>
</div>
</div>
<script src="script.js"></script>
</body>
</html>
#style.css
@import url("https://fonts.googleapis.com/css2?
family=Poppins:wght@300;400;500;600;700&display=swap");
*{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "Poppins", sans-serif;
}
body {
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background: #e0e3eb;
}
.container {
position: relative;
max-width: 300px;
width: 100%;
border-radius: 12px;
padding: 10px 20px 20px;
background: #fff;
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.05);
}
.display {
height: 80px;
width: 100%;
outline: none;
border: none;
text-align: right;
margin-bottom: 10px;
font-size: 25px;
color: #000e1a;
pointer-events: none;
}
.buttons {
display: grid;
grid-gap: 10px;
grid-template-columns: repeat(4, 1fr);
}
.buttons button {
padding: 10px;
border-radius: 6px;
border: none;
font-size: 20px;
cursor: pointer;
background-color: #eee;
}
.buttons button:active {
transform: scale(0.99);
}
.operator {
color: #2f9fff;
}
#script.js
const display = document.querySelector(".display");
const buttons = document.querySelectorAll("button");
const specialChars = ["%", "*", "/", "-", "+", "="];
let output = "";
#Output
Experiment 12:validation of forms including password
using java script
#Objective:
Validation of forms including password using Javascript.
Code:
Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Registration Form with Validation</title>
<link rel="stylesheet" href="styles.css">
</head>
<style>
/* General Body Styles */
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
.container {
background-color: #fff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
width: 100%;
max-width: 400px;
}
h2 {
text-align: center;
margin-bottom: 20px;
}
.form-group {
margin-bottom: 15px;
}
label {
font-size: 16px;
font-weight: bold;
display: block;
margin-bottom: 5px;
}
input[type="text"],
input[type="password"] {
width: 100%;
padding: 10px;
font-size: 16px;
border: 1px solid #ddd;
border-radius: 4px;
}
input[type="text"]:focus,
input[type="password"]:focus {
border-color: #0056b3;
outline: none;
}
.submit-btn {
width: 100%;
padding: 12px;
font-size: 16px;
background-color: #0056b3;
color: #fff;
border: none;
border-radius: 4px;
cursor: pointer;
}
.submit-btn:hover {
background-color: #00408a;
}
.error {
color: red;
font-size: 14px;
margin-top: 10px;
}
</style>
<script>
function validateForm() {
var username = document.getElementById("username").value;
var password = document.getElementById("password").value;
var confirmPassword = document.getElementById("confirmPassword").value;
var errorMessage = document.getElementById("errorMessage");
errorMessage.textContent = "";
if (username === "") {
errorMessage.textContent = "Username is required.";
return false;
}
var passwordRegex = /^(?=.*[A-Za-z])(?=.*\d)(?=.*[!@#$%^&*])[A-Za-z\d!@#$%^&*]
{6,}$/;
if (!passwordRegex.test(password)) {
errorMessage.textContent = "Password must be at least 6 characters long, contain a
letter, a number, and a special character.";
return false;
}
if (password !== confirmPassword) {
errorMessage.textContent = "Passwords do not match.";
return false;
}
return true;
}
</script>
<body>
<div class="container">
<h2>Registration Form</h2>
<form id="myForm" onsubmit="return validateForm()" method="POST">
<div class="form-group">
<label for="username">Username:</label>
<input type="text" id="username" name="username" required>
</div>
<div class="form-group">
<label for="password">Password:</label>
<input type="password" id="password" name="password" required>
</div>
<div class="form-group">
<label for="confirmPassword">Confirm Password:</label>
<input type="password" id="confirmPassword" name="confirmPassword"
required>
</div>
<script src="script.js"></script>
</body>
</html>
#Output