UNITED COLLEGE OF ENGINEERING & RESEARCH
GREATER NOIDA
Department of Computer Science & Eng.
CODE: BCS-353
WEB DESIGNING WORKSHOP
SUBMITTED BY – Ayush srivastava
ROLL NO: 2301930100029
B. TECH. CSE 3RD SEM.
SUBMITTED TO: MS. VANDANA RAJPUT
Session:2024-2025
INDEX
S. No Title Date Signature
1. Static home page
2. Login Page
3. Catalogue Page
4. Cart Page
5. Registration Page
6. Js validation 1. Name,
2.Password
7. Js Validation 1. Email
2. Phone Number
8. Design web page using CSS
Q1) Design a static webpages required for an online book store website.
HOMEPAGE: The static home page must contain three frames.
Top frame: Logo and the college name and links to Homepage, Login page, Registration
page, Catalogue page and Cart page .
CODE:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Static Web Page</title>
<style>
table {
width: 100%;
border-collapse: collapse;
}
th, td {
border: 1px solid black;
padding: 10px;
text-align: center;
}
th {
background-color: #cbe424;
}
.left-column {
text-align: left;
}
</style>
</head>
<body>
<table>
<tr>
<th rowspan="2"><img src="united-college-logo.png"></th>
<th colspan="5">United college of engineering and research</th>
</tr>
<tr>
<th>Home</th>
<th>Login</th>
<th>Registration</th>
<th>Catalogue</th>
<th>Cart</th>
</tr>
<tr>
<td class="left-column">CSE</td>
<td rowspan="4" colspan="5">Description of the WebSite</td>
</tr>
<tr>
<td class="left-column">ECE</td>
</tr>
<tr>
<td class="left-column">EEE</td>
</tr>
<tr>
<td class="left-column">CIVIL</td>
</tr>
</table>
</body>
</html>
Q2) LOGIN PAGE:
CODE:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Static Web Page</title>
<style>
table {
width: 100%;
border-collapse: collapse;
}
th, td {
border: 1px solid black;
padding: 10px;
text-align: center;
}
th {
background-color: # cbe424;
}
.left-column {
text-align: left;
}
.login-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
}
.login-container input {
margin: 5px;
padding: 8px;
}
</style>
</head>
<body>
<table>
<tr>
<th rowspan="2"><img src="united-college-logo.png" alt="Logo"
width="50"></th>
<th colspan="5">United college of engineering and research</th>
</tr>
<tr>
<th>Home</th>
<th>Login</th>
<th>Registration</th>
<th>Catalogue</th>
<th>Cart</th>
</tr>
<tr>
<td class="left-column">CSE</td>
<td rowspan="4" colspan="5">
<div class="login-container">
<h2>Login</h2>
<input type="text" placeholder="Username">
<input type="password" placeholder="Password">
<button>Login</button>
</div>
</td>
</tr>
<tr>
<td class="left-column">ECE</td>
</tr>
<tr>
<td class="left-column">EEE</td>
</tr>
<tr>
<td class="left-column">CIVIL</td>
</tr>
</table>
</body>
</html>
Q3) Catalogue Page : The catalogue page should contain the details of all the books
available in the website in a table.
The details should contain the following:
1.Snap shot of Cover Page
2.Author Name
3. Publisher
4. Price
5. Add to cart button
CODE:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Book Store</title>
<style>
body {
font-family: Arial, sans-serif;
}
table {
width: 100%;
border-collapse: collapse;
}
th, td {
border: 1px solid black;
padding: 10px;
text-align: left;
}
th {
background-color: #f4a460;
}
.sidebar {
width: 20%;
float: left;
background: #f0f0f0;
padding: 10px;
}
.content {
width: 75%;
float: right;
padding: 20px;
}
.book img {
width: 100px;
height: auto;
}
.add-cart {
background-color: #ffa500;
border: none;
padding: 5px 10px;
cursor: pointer;
}
</style>
</head>
<body>
<table>
<tr>
<th>Logo</th>
<th colspan="4">United College of engineering</th>
</tr>
<tr>
<td rowspan="5">
</td>
<td>Home</td>
<td>Login</td>
<td>Registration</td>
<td>Catalogue</td>
<td>Cart</td>
</tr>
<tr>
<td><img src="Screenshot 2025-01-29 152510.png" alt="XML
Bible"></td>
<td colspan="2">Book: Hc verma<br>Author: Hc
verma<br>Publication: Concise</td>
<td>Rs360</td>
<td><button class="add-cart">Add to Cart</button></td>
</tr>
<tr>
<td><img src="Screenshot 2025-01-29 152820.png" alt="AI"></td>
<td colspan="2">Book: Irodov<br>Author: Irodov<br>Publication: Mir
publisher mosco</td>
<td>Rs 500</td>
<td><button class="add-cart">Add to Cart</button></td>
</tr>
<tr>
<td><img src="Screenshot 2025-01-29 153044.png" alt="Java 2"></td>
<td colspan="2">Book: Rich dad Poor dad 2<br>Author: Robort
kiyosaki<br>Publication: Penguin</td>
<td>Rs 350</td>
<td><button class="add-cart">Add to Cart</button></td>
</tr>
<tr>
<td><img src="Screenshot 2025-01-29 153306.png" alt="HTML in 24
Hours"></td>
<td colspan="2">Book: How to win and influence people<br>Author:
dale carnegie<br>Publication: Simson</td>
<td>Rs 480</td>
<td><button class="add-cart">Add to Cart</button></td>
</tr>
</table>
</body>
</html>
4) CARTPAGE: The cart page contains the details about the books which are added to
the cart.
CODE:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Book Store</title>
<style>
body {
font-family: Arial, sans-serif;
}
table {
width: 100%;
border-collapse: collapse;
}
th, td {
border: 1px solid black;
padding: 10px;
text-align: left;
}
th {
background-color: #f4a460;
}
.book img {
width: 100px;
height: auto;
}
.add-cart {
background-color: #ffa500;
border: none;
padding: 5px 10px;
cursor: pointer;
}
#cart-items {
margin-top: 20px;
padding: 10px;
border: 1px solid black;
background-color: #f0f0f0;
display: none;
}
</style>
</head>
<body>
<table>
<tr>
<th>Logo</th>
<th colspan="4">United College of Engineering</th>
</tr>
<tr>
<td rowspan="5"></td>
<td>Home</td>
<td>Login</td>
<td>Registration</td>
<td>Catalogue</td>
<td>Cart</td>
</tr>
<tr>
<td><img src="Screenshot 2025-01-29 152510.png" alt="XML Bible"></td>
<td colspan="2">Book: Hc Verma<br>Author: Hc Verma<br>Publication:
Concise</td>
<td>Rs360</td>
<td><button class="add-cart" onclick="addToCart('Hc Verma', 360)">Add to
Cart</button></td>
</tr>
<tr>
<td><img src="Screenshot 2025-01-29 152820.png" alt="AI"></td>
<td colspan="2">Book: Irodov<br>Author: Irodov<br>Publication: Mir Publisher
Moscow</td>
<td>Rs500</td>
<td><button class="add-cart" onclick="addToCart('Irodov', 500)">Add to
Cart</button></td>
</tr>
<tr>
<td><img src="Screenshot 2025-01-29 153044.png" alt="Java 2"></td>
<td colspan="2">Book: Rich Dad Poor Dad 2<br>Author: Robert
Kiyosaki<br>Publication: Penguin</td>
<td>Rs350</td>
<td><button class="add-cart" onclick="addToCart('Rich Dad Poor Dad 2',
350)">Add to Cart</button></td>
</tr>
<tr>
<td><img src="Screenshot 2025-01-29 153306.png" alt="HTML in 24 Hours"></td>
<td colspan="2">Book: How to Win Friends and Influence People<br>Author: Dale
Carnegie<br>Publication: Simson</td>
<td>Rs480</td>
<td><button class="add-cart" onclick="addToCart('How to Win Friends and
Influence People', 480)">Add to Cart</button></td>
</tr>
</table>
<button onclick="showCart()">Show Cart</button>
<div id="cart-items">
<h3>Cart Items</h3>
<ul id="cart-list"></ul>
</div>
<script>
let cart = [];
function addToCart(book, price) {
cart.push({ book, price });
alert(book + " added to cart!");
}
function showCart() {
let cartDiv = document.getElementById("cart-items");
let cartList = document.getElementById("cart-list");
cartList.innerHTML = "";
if (cart.length === 0) {
cartList.innerHTML = "<li>No items in cart</li>";
} else {
cart.forEach(item => {
let li = document.createElement("li");
li.textContent = item.book + " - Rs" + item.price;
cartList.appendChild(li);
});
}
cartDiv.style.display = "block";
}
</script>
</body>
</html>
5)REGISTRATION PAGE :
Create a“ registration form“ with the following fields
1)Name (Text field)
2)Password (password field)
3) E-mailid(text field)
4) Phone Number(text field)
5) Sex(radio button)
6) Date of birth(3 select boxes)
7) Languages known(checkboxes–English, Telugu, Hindi, Tamil)
8) Address(text area)
CODE:
<!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>
.fullPage{
padding: 40px;
margin: 50px;
text-align:left;
height: 700px;
width: 500px;
background-color: #25bbe0;
}
.name{
margin: 10px ;
}
.pass{
margin: 10px;
}
.mail{
margin: 10px;
}
.contact{
margin: 10px;
}
.sex{
margin: 10px;
}
.birth{
margin: 10px;
}
.lang{
margin: 10px;
}
.address{
margin: 10px;}
</style>
</head>
<body>
<div class="fullPage"><form action=""> <div class="name"><label
for="name">
Name: </label>
<input type="text" name="" id="name" placeholder="Enter your
name:"></div>
<div class="pass"><label for="pass">Password: </label>
<input type="password" name="" id="pass" placeholder="password"></div>
<div class="mail"><label
for="mail">mail: &n
bsp;</label>
<input type="email" name="" id="mail" placeholder="Enter your
email:"></div>
<div class="contact"><label
for="contact">contact: </label>
<input type="number" name="" id="contact" placeholder="Enter your contact
number:"></div>
<div class="sex"><label for="sex">Sex:
</label>
<label for="male">male</label>
<input type="radio" id="male">
<label for="female">female</label>
<input type="radio" name="" id="female"></div>
<div class="birth"><label
for="birth">D.O.B: </label>
<input type="date" name="" id="birth"></div>
<div class="lang">
<div class="lanHead"><p>Select your language:</p></div>
<label for="hindi">
 
;
Hindi</label>
<input type="checkbox" id="hindi">
<label for="eng">English</label>
<input type="checkbox" id="eng">
<label for="tamil">Tamil</label>
<input type="checkbox" id="tamil">
<label for="urdu">Urdu</label>
<input type="checkbox" id="urdu">
</div>
<div class="address"><label for="add">Address: </label>
<input type="'text'" name="" id="add" placeholder="Enter your
address:"></div>
</form>
</div>
</body>
</html>
6) Js VALIDATION: Write JavaScript to validate the following fields of the above
registration page.
1. Name (Name should contains alphabets and the length should not be less than 6
characters).
2. Password (Password should not be less than 6 characters length).
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</title>
<style>
.fullPage {
padding: 40px;
margin: 50px;
text-align: left;
height: 700px;
width: 500px;
background-color: #25bbe0;
}
.fullPage div {
margin: 10px;
}
</style>
</head>
<body>
<div class="fullPage">
<form id="registrationForm">
<div class="name">
<label
for="name">Name: </label>
<input type="text" id="name" placeholder="Enter your name:">
</div>
<div class="pass">
<label for="pass">Password: </label>
<input type="password" id="pass" placeholder="password">
</div>
<div class="mail">
<label
for="mail">Mail: </label>
<input type="email" id="mail" placeholder="Enter your email:">
</div>
<div class="contact">
<label for="contact">Contact: </label>
<input type="number" id="contact" placeholder="Enter your contact number:">
</div>
<div class="sex">
<label for="sex">Sex:
</label>
<label for="male">Male</label>
<input type="radio" id="male" name="gender">
<label for="female">Female</label>
<input type="radio" id="female" name="gender">
</div>
<div class="birth">
<label for="birth">D.O.B: </label>
<input type="date" id="birth">
</div>
<div class="lang">
<p>Select your language:</p>
<label for="hindi">Hindi</label>
<input type="checkbox" id="hindi">
<label for="eng">English</label>
<input type="checkbox" id="eng">
<label for="tamil">Tamil</label>
<input type="checkbox" id="tamil">
<label for="urdu">Urdu</label>
<input type="checkbox" id="urdu">
</div>
<div class="address">
<label for="add">Address: </label>
<input type="text" id="add" placeholder="Enter your address:">
</div>
<div>
<button type="submit">Submit</button>
</div>
</form>
</div>
<script>
document.getElementById("registrationForm").addEventListener("submit",
function(event) {
event.preventDefault(); // Prevent form submission
let name = document.getElementById("name").value.trim();
let password = document.getElementById("pass").value.trim();
let nameRegex = /^[A-Za-z\s]{6,}$/; // Only alphabets, at least 6 characters
if (!nameRegex.test(name)) {
alert("Name should contain only alphabets and be at least 6 characters long.");
return false;
}
if (password.length < 6) {
alert("Password must be at least 6 characters long.");
return false;
}
alert("Form submitted successfully!");
return true;
});
</script>
</body>
</html>
7) Js VALIDATION:
1. E-mailid (should not contain any invalid and must follow the standard
pattern([email protected])
2. Phone Number(Phone number should contain 10 digits only).
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</title>
<style>
.fullPage {
padding: 40px;
margin: 50px;
text-align: left;
height: auto;
width: 500px;
background-color: #25bbe0;
}
.fullPage div {
margin: 10px;
}
</style>
</head>
<body>
<div class="fullPage">
<form id="registrationForm">
<div class="name">
<label
for="name">Name: </label>
<input type="text" id="name" placeholder="Enter your name:">
</div>
<div class="pass">
<label for="pass">Password: </label>
<input type="password" id="pass" placeholder="password">
</div>
<div class="mail">
<label
for="mail">Mail: </label>
<input type="email" id="mail" placeholder="Enter your email:">
</div>
<div class="contact">
<label for="contact">Contact: </label>
<input type="number" id="contact" placeholder="Enter your contact number:">
</div>
<div class="sex">
<label for="sex">Sex:
</label>
<label for="male">Male</label>
<input type="radio" id="male" name="gender">
<label for="female">Female</label>
<input type="radio" id="female" name="gender">
</div>
<div class="birth">
<label for="birth">D.O.B: </label>
<input type="date" id="birth">
</div>
<div class="lang">
<p>Select your language:</p>
<label for="hindi">Hindi</label>
<input type="checkbox" id="hindi">
<label for="eng">English</label>
<input type="checkbox" id="eng">
<label for="tamil">Tamil</label>
<input type="checkbox" id="tamil">
<label for="urdu">Urdu</label>
<input type="checkbox" id="urdu">
</div>
<div class="address">
<label for="add">Address: </label>
<input type="text" id="add" placeholder="Enter your address:">
</div>
<div>
<button type="submit">Submit</button>
</div>
</form>
</div>
<script>
document.getElementById("registrationForm").addEventListener("submit",
function(event) {
event.preventDefault(); // Prevent form submission
let email = document.getElementById("mail").value.trim();
let contact = document.getElementById("contact").value.trim();
let emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/; // Valid email
pattern
let phoneRegex = /^[0-9]{10}$/; // 10-digit phone number
if (!emailRegex.test(email)) {
alert("Please enter a valid email address.");
return false;
}
if (!phoneRegex.test(contact)) {
alert("Please enter a valid 10-digit phone number.");
return false;
}
alert("Form submitted successfully!");
return true;
});
</script>
</body>
</html>
RAM SINGH
8) CSS:
Design a web page using CSS(Cascading Style Sheets) 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:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Book Store</title>
<style>
body {
font-family: Arial, sans-serif;
}
table {
width: 100%;
border-collapse: collapse;
}
th, td {
border: 1px solid black;
padding: 10px;
text-align: left;
}
th {
background-color: #f4a460;
}
.book img {
width: 100px;
height: auto;
}
.add-cart {
background-color: #ffa500;
border: none;
padding: 5px 10px;
cursor: pointer;
}
#cart-items {
margin-top: 20px;
padding: 10px;
border: 1px solid black;
background-color: #f0f0f0;
display: none;
}
</style>
</head>
<body>
<table>
<tr>
<th>Logo</th>
<th colspan="4">United College of Engineering</th>
</tr>
<tr>
<td rowspan="5"></td>
<td>Home</td>
<td>Login</td>
<td>Registration</td>
<td>Catalogue</td>
<td>Cart</td>
</tr>
<tr>
<td><img src="Screenshot 2025-01-29 152510.png" alt="XML Bible"></td>
<td colspan="2">Book: Hc Verma<br>Author: Hc Verma<br>Publication:
Concise</td>
<td>Rs360</td>
<td><button class="add-cart" onclick="addToCart('Hc Verma', 360)">Add to
Cart</button></td>
</tr>
<tr>
<td><img src="Screenshot 2025-01-29 152820.png" alt="AI"></td>
<td colspan="2">Book: Irodov<br>Author: Irodov<br>Publication: Mir Publisher
Moscow</td>
<td>Rs500</td>
<td><button class="add-cart" onclick="addToCart('Irodov', 500)">Add to
Cart</button></td>
</tr>
<tr>
<td><img src="Screenshot 2025-01-29 153044.png" alt="Java 2"></td>
<td colspan="2">Book: Rich Dad Poor Dad 2<br>Author: Robert
Kiyosaki<br>Publication: Penguin</td>
<td>Rs350</td>
<td><button class="add-cart" onclick="addToCart('Rich Dad Poor Dad 2',
350)">Add to Cart</button></td>
</tr>
<tr>
<td><img src="Screenshot 2025-01-29 153306.png" alt="HTML in 24 Hours"></td>
<td colspan="2">Book: How to Win Friends and Influence People<br>Author: Dale
Carnegie<br>Publication: Simson</td>
<td>Rs480</td>
<td><button class="add-cart" onclick="addToCart('How to Win Friends and
Influence People', 480)">Add to Cart</button></td>
</tr>
</table>
<button onclick="showCart()">Show Cart</button>
<div id="cart-items">
<h3>Cart Items</h3>
<ul id="cart-list"></ul>
</div>
<script>
let cart = [];
function addToCart(book, price) {
cart.push({ book, price });
alert(book + " added to cart!");
}
function showCart() {
let cartDiv = document.getElementById("cart-items");
let cartList = document.getElementById("cart-list");
cartList.innerHTML = "";
if (cart.length === 0) {
cartList.innerHTML = "<li>No items in cart</li>";
} else {
cart.forEach(item => {
let li = document.createElement("li");
li.textContent = item.book + " - Rs" + item.price;
cartList.appendChild(li);
});
}
cartDiv.style.display = "block";
}
</script>
</body>
</html>