Webd
Webd
Ghaziabad
Name
Roll No.
Section- Batch
INDEX
Experiment Experiment Name Date of Date of Faculty
No. Signature
Conduction Submission
1. Design the following static web pages required
for an online book store website.
HOMEPAGE:
Top frame: Logo and the college name and links to Homepage, Loginpage, Registration
page, Catalogue page and Cart page.
Code: -Homepage
<head>
<frameset rows="20%,*">
<frame src="topframe.html"name="f1">
<frameset cols="20%,*">
<frame src="leftframe.html"name="f2">
<frame src="rightframe.html"name="f3">
</frameset>
</frameset>
</head>
OUTPUT:
Top frame:
<html>
<body>
<p>
<img src="C:\Documents and Settings\All Users\Documents\My
Pictures\Sample Pictures\Winter.jpg" align=left width=100 height=100">
<h1 align=center>Online book store</h1>
</p>
<br>
<p>
<h2> nbsp;
<a href="homepage.html" target=_parent> Home
</a>
<a href="login.html" target="f3"> login
</a>
<a href="registration.html" target="f3"> registration
</a> nbsp;
<a href="catalogue.html" target="f3"> Catalogue
</a>
<a href="cart.html" target="f3"> Cart
</a>
</h2>
</p>
</body>
</html>
Output
Left frame:
<html>
<body>
</body>
</html>
OUTPUT:
Right frame:
<html>
<body bgcolor="pink">
<p>
</p>
</body>
</html>
OUTPUT
Experiment No.2
Aim: - Login Page: The login page contains the user name
and the password of the user to authenticate.
Code:
<html>
<body>
<p>
</p>
<br>
<p>
<h2>
</h2>
</p>
</body>
</html>
OUTPUT:
Experiment No.3
4. Price.
5. Add to cart button
Code: -
<html>
<body>
<center>
<table border=1>
<tr>
<th> Book Preview </th>
<th> Book Details </th>
<th> Price </th>
<th> Payment </th>
</tr>
<tr>
<td> <img src="image.jpg" width=100 height=50>
</td>
<td>
<pre>
<font face="comic sans ms" size=4 color="green" > book:XML Bible
Author:winston Publisher:Wiesley
</font>
</pre>
</td>
<td> $40 </td>
<td> <a href="cart.html" target="_blank">
<img src="C:\Users\kivi2\Downloads\1234.png"
width="150" height="100">
</a>
</td>
</tr>
<tr>
Aim: - The cart page contains the details about the books which
are added to the cart.
Code:
<html>
<body>
<center><br><br><br>
<img src=”E:\aa.jpg”>
<thead>
<tr>
<th>Book name</th>
<th>price</th>
<th>quantity</th>
<th>amount</th>
</tr>
</thead>
<tr>
<td>java 2</td>
<td>$45</td>
<td>2</td>
<td>$70</td>
</tr>
<tr>
<td> $20</td>
<td> 5</td>
<td> $40</td>
</tr>
</th>
</tr>
</table>
</center>
</body>
</html>
OUTPUT:
Experiment No. 5
Code: -
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Registration Form</title>
</head>
<body>
<h1>Registration Form</h1>
<label for="name">Name:</label>
<input type="text" id="name" name="name" required><br><br>
<label for="password">Password:</label>
<label for="email">E-mail:</label>
<label>Sex:</label>
<label for="male">Male</label>
<label for="female">Female</label>
<label for="other">Other</label><br><br>
<option value="">Day</option>
</select>
<option value="">Month</option>
</select>
<option value="">Year</option>
<!-- Add year options here -->
</select><br><br>
<label>Languages known:</label>
<label for="english">English</label>
<label for="telugu">Telugu</label>
<label for="hindi">Hindi</label>
<label for="tamil">Tamil</label><br><br>
<label for="address">Address:</label><br>
</form>
</body>
</html>
Output: -
Experiment No. 6
Aim: - 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 Page</title>
<script> function validateForm() {
// Name validation
var name = document.getElementById("name").value; if (!/^[a-
zA-Z]{6,}$/.test(name)) {
alert("Name should contain alphabets only and have at least 6
characters."); return false;
}
// Password validation
var password = document.getElementById("password").value; if
(password.length < 6) {
alert ("Password should be at least 6 characters long.");
return false;
}// Form is valid
return true;
}
</script>
</head>
<body>
<h1>Registration Page</h1>
<form onsubmit="return validateForm()">
<label for="name">Name:</label>
<input type="text" id="name" name="name"
required><br><br>
<label for="password">Password:</label>
<input type="password" id="password" name="password"
required><br><br>
<input type="submit" value="Register">
</form>
</body>
</html>
Output: -
Experiment No. 7
Aim: - JS VALIDATION:
Code: -
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Form Validation</title>
<style>
</style>
</head>
<body>
<h1>Form Validation</h1>
<form id="myForm" onsubmit="return validateForm()">
<label for="email">E-mail:</label>
</form>
<script>
function validateForm() {
if (!emailPattern.test(emailInput)) {
if (!phonePattern.test(phoneInput)) {
</script>
</body>
</html>
Output: -
Experiment No. 8
Aim: - CSS: Design a web page using CSS (Cascading Style Sheets) which
includes the following:
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.
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">
<style>
h1 {
color: #009688;
p{
line-height: 1.5;
background-repeat: no-repeat;
.highlight-box {
background-image: url('highlight-background.jpg');
</style>
</head>
<body>
<p>This is an example of a web page styled using CSS. You can use different
fonts and set background images for elements on the page.</p>
<div class="highlight-box">
<h2>Highlighted Section</h2>
<p>This section has a custom background image set using CSS. You can apply
various styles to make your content stand out.</p>
</div>
<p>Feel free to explore and experiment with different styles and backgrounds for
your web pages!</p>
</body>
</html>
Output: -
Experiment No. 9
Aim: - CSS:
Control the repetition of the image with the background-repeat
property.
Code: -
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
background-image: url('image.jpg');
a:visited {
a:active {
a:hover {
.container {
h1 {
color: #333;
p{
color: #666;
</style>
</head>
<body>
<div class="container">
<h1>Welcome to My CSS Page</h1>
<p>This is an example of a web page styled using CSS. You can control the
repetition of background images and define styles for links.</p>
<p>Feel free to <a href="#">explore</a> and <a href="#">click</a> on the links to
see how they change on interaction</p>
</div>
</body>
</html>
Output: -
Experiment No. 10
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Survey Form</title>
padding: 0;
}
header {
.container {
border-radius: 5px;
h1 {
color: #333;
text-align: center;
label {
}
input[type="text"], input[type="email"] { width: 100%;
select {
.btn {
.btn:hover {
background-color: #2187c0;
}
/* JavaScript Validation */
.error {
</style>
</head>
<body>
<header>
<h1>Survey Form</h1>
</header>
<div class="container">
<label for="name">Name:</label>
<label for="email">Email:</label>
<label for="age">Age:</label>
<option value="18-30">18-30</option>
<option value="31-50">31-50</option>
</select>
<label for="comments">Comments:</label>
</form>
</div>
<script>
});
</script>
</body>
</html>
Output: -