Web Tech
Web Tech
Department of CS (SoCSET)
LAB FILE
ON
Web Technology
(ACSE-0555)
(5th Semester)
Affiliated to Dr. A.P.J Abdul Kalam Technical University, Uttar Pradesh, Lucknow
NOIDA INSTITUTE OF ENGINEERING AND
TECHNOLOGY GREATER NOIDA-201306
(An Autonomous Institute)
School of Computer Sciences & Engineering in Emerging Technologies
<html>
<head>
<title>HEADINGS</title>
</head>
<body>
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
</body>
</html>
Output
Program 2
Implementing HTML program that represents the use of paragraph tag.
<!DOCTYPE html>
<html>
<head>
<title>Paragraph Tag</title>
</head>
<body>
<h1>Hello, World!</h1>
</body>
</html>
Output
Program 3
Implementing HTML program to display your simple Resume.
<html>
<head>
<title>Resume</title>
<h1 align="center"><u>Resume<b></b></u></h1>
<h2>Riya Pal</h2>
</p>
<h3><u>Career Objective:</u></h3>
<p>
To build technical skills and gain experience over it. To gather knowledge and
utilize it in a company.
</p>
<h3><u>Educational Qualification:</u></h3>
<p>
<UL>
<li>Graduation
</li>
</li>
</UL>
</p>
<h3><u>Skills:</u></h3>
<p>
Languages Known:-
<UL TYPE="Disc">
<li>HTML</li>
<li>Java</li>
<li>Python</li>
</UL>
*Cloud Computing
*Artificial Intelligence
*Machine Learning
*Android Development
</p>
<h3><u>Interests:</u></h3>
<p>
<UL TYPE="Disc">
<li>Coding</li>
<li>Communication Skills</li>
<li>Creative Art</li>
</UL>
</p>
</body>
</head>
</html>
Output
Program 4.
Creating html document that implements the use of text formatting tags.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Table</title>
</head>
<body>
<table border="1">
<tr>
<th>HTML Tags</th>
<th>Output</th>
</tr>
<tr>
<td>normal text</td>
<td>hello world</td>
</tr>
<tr>
</tr>
<tr>
<td><B ></td>
<td><b>bold</b></td>
</tr>
<tr>
<td><I ></td>
<td><i>italic</i></td>
</tr>
<tr>
<td><U ></td>
<TD><U>Underline</U></TD>
</tr>
<tr>
<td><EM ></td>
<td> <em>Emphasis</em></td>
</tr>
<tr>
<TD><strong>STRONG</strong></TD>
</tr>
<tr>
<td><TELETYPE ></td>
<td><tt>TELETYPE</tt></td>
</tr>
<tr>
<td><CITE ></td>
<td><cite>Citation</cite></td>
</tr>
<tr>
<td><STRIKE ></td>
</tr>
<TR>
<td><BIG ></td>
</TR>
<tr>
<td><SMALL ></td>
</tr>
<TR>
<td><SUB ></td>
<td>a <sub>b</sub></td>
</TR>
<tr>
<td><SUP ></td>
<td>a <sup>b</sup></td>
</tr>
</table>
</body>
</html>
Output
Program 5
To Create a table to show your class/training timetable.
<html lang="en">
<head>
<meta charset="UTF-8">
scale=1.0"> <title>Document</title>
</head>
<body>
<caption>Time Table</caption>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
<th bgcolor="Pink">Coordinator:</th>
<th bgcolor="Pink" colspan="5"><center>Noida Institute of Engineering &
Technology, Greater Noida</center></th>
</tr>
<tr>
<td>Day/Time</td>
<td><center>9:10-10:00</center></td>
<td><center>10:00-10:50</center></td>
<td><center>10:50-11:40</center></td>
<td><center>11:40-12:30</center></td>
<td><center>12:30-1:30</center></td>
<td><center>1:30-2:30</center></td>
<td><center>2:30-3:20</center></td>
<td><center>3:20-4:10</center></td>
<td><center>4:10-5:00</center></td>
</tr>
<tr>
<td>DAA(L)</td>
<td>CN(L)</td>
<td>COI(L)</td>
<td>MOOCs(L)</td>
</tr>
<tr>
<td>SCH</td>
<td>DRT</td>
<td>HRS</td>
<td>SBF(Lab 317)</td>
</tr>
<tr>
<td>DT(L)</td>
<td>MOOCs(L)</td>
</tr>
<tr>
<td>YDS</td>
<td>SFS Lab-102</td>
</tr>
<tr>
<td rowspan="2"
bgcolor="blue">WEDNESDAY</td> <td>CN(L)</td>
<td colspan="2">CN(LAB-003B)</td>
<td>DAA(L)</td>
</tr>
<tr>
<td>DRT</td>
<td colspan="2">PRP+DPN</td>
<td >SCH</td>
</tr>
<tr>
<td>DAA(L)</td>
<td>CN(L)</td>
<td>DAA(L)</td>
<td>DT(L)</td>
</tr>
<tr>
<td>SCH</td>
<td>DRT</td>
<td>SCH</td>
<td>YDS</td>
</tr>
<tr>
<td >DT(L)</td>
</tr>
<tr>
<td>YDS + RTM</td>
<td>YDS</td>
<td colspan="2">VKT+SVM</td>
</tr>
</table>
</body>
</html>
Output
Program 6
Write HTML program to create a Registration Form.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Form</title>
<script>
function myfun()
alert("Thank You");
</script>
</head>
<body bgcolor="Orange">
Title<select name="Title">
<option value="Mr.">Mr.</option>
<option value="Ms.">Ms.</option>
</select><br>
<input type="text"><br>
State:<select name="State">
<option value="Gujarat">Gujarat</option>
<input type="submit"name="submit"><br>
</form>
</table>
Output
Program 7
Design a School Registration form using Table.
<!DOCTYPE html>
<html>
<head>
</head>
<body
background=https://t4.ftcdn.net/jpg/00/83/70/91/360_F_83709107_0EnUor7Bw67kgJP8XxB
GY9yUlTGeXq3N.jpg>
<form>
<table>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
<td><label for="grade">Grade:</label></td>
<td>
<option>Select</option>
</select>
</td>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
</table>
</form>
</body>
</html>
Output
Program 8
Implementation of color style in headings using CSS.
<!DOCTYPE html>
<html>
<head>
<style>
h1 {
color: red;
text-align: center;
h2 {
text-align: center;
h3 {
text-align: center;
h4 {
text-align: center;
h5 {
text-align: center;
h6 {
color: rgb(189, 95, 151);
text-align: center;
</style>
</head>
<body>
<h1>Hello World!</h1>
<h2>Riya Pal.</h2>
<h4>Coder, Writer</h4>
<h5>Singer</h5>
<h6>Dancer</h6>
</body>
</html>
Output
Program 9
Demonstrating the CSS Box model with consists of- borders, padding,
margins, and the actual content.
<!DOCTYPE html>
<html>
<head>
<style>
.boxmodel {
width: 300px;
height: 300px;
padding: 25px;
margin: 30px;
.childContainer{ di
splay:flex;
justify-content: center;
align-items: center;
</style>
</head>
Child Container
</div>
<p>Demonstrating the CSS Box model with consists of: borders, padding, margins,
and the actual content.
</p>
</div>
</body>
</html>
Output
Program 10
Demonstrate the use of Selectors in CSS.
<!DOCTYPE html>
<html>
<head>
<style>
p{
font-size: 40px;
color: blueviolet;
background-color: yellow;
font-size: 40px;
</style>
</head>
<body>
<p>
Introduction
</p>
Raipur.</p> </div>
</body>
</html>
Output
Program 11
Applying a block element in CSS acquires up the full width available for
that content.
<!DOCTYPE html>
<html>
<head>
<style>
.block-element {
background-color: #f0f0f0;
padding: 10px;
/* The following properties ensure the element takes up the full width available */
display: block;
width: 100%;
box-sizing: border-box; }
</style>
</head>
<body>
<div class="block-element">
This is a block-level element. It takes up the full width available within its
containing block.
</div>
</body>
</html> Output
Program 12
Demonstrate the use of Grid Layout in CSS.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
body
{ margin:
40px;
.wrapper
{ display:
grid; gap:
10px;
grid-template-rows: repeat(3,minmax(100px,auto));
background-color: #fff;
color: #444;
.box {
background-color: #444;
color: #fff;
border-radius: 5px;
padding: 20px;
font-size: 150%;
.box .box {
background-color: #ccc;
color: #444;
.a {
grid-column: 1 / 3;
.b {
grid-column: 4 ;
.c {
grid-column: 1;
grid-row: 2 / 4;
.d{
grid-column: 2 / 5;
grid-row: 2 / 4;
display: grid;
grid-template-columns: subgrid;
grid-template-rows: subgrid;
</style>
</head>
<body>
<div class="wrapper">
</div>
</div>
</body>
</html>
Output
Program 13
Design a XML Schema that describes the structure of an XML document.
<?xml version="1.0" encoding="UTF-8"?>
<cllg>
<cllg_name>NIET</cllg_name>
<Name>Anirudh</Name>
<Brnch>CSE</Brnch>
<RollNo.>23</RollNo.>
<ContactNo.>98654</ContactNo.>
</cllg>
Output
Program 14
Design an XML document to record data of a library. The XML document
should have at least 5 records.
<?xml version="1.0" encoding="UTF-8"?>
<library>
<book>
<author>Jane Austen</author>
<publication_year>1813</publication_year>
<isbn>978-0141439518</isbn>
</book>
<book>
<title>The Alchemist</title>
<publication_year>1988</publication_year>
<isbn>978-8172234980</isbn>
<genre>Novel</genre>
</book>
<book>
<title>Atomic Habits</title>
<author>James Clear</author>
<publication_year>2018</publication_year>
<isbn>978-0735211292</isbn>
<genre>Self-Help Book</genre>
</book>
<book>
<title>Half Girlfriend</title>
<author>Chetan Bhagat</author>
<publication_year>2014</publication_year>
<isbn>978-9351980353</isbn>
</book>
<book>
<author>Leo Tolstoy</author>
<publication_year>1869</publication_year>
<isbn>978-0198800545</isbn>
<genre>Classic</genre>
</book>
</library>
Output
Program 15
Design a HTML form validation using Java Script.
<!DOCTYPE html>
<html>
<head>
<title>Form Validation</title>
</head>
<body>
<h1>Form Validation Example</h1>
<label for="email">Email:</label>
<input type="email" id="email" name="email" required><br>
<label for="password">Password:</label>
<input type="password" id="password" name="password" required><br>
<script>
function validateForm() {
var name = document.getElementById("name").value;
var email = document.getElementById("email").value;
var password = document.getElementById("password").value;
if (!isValidEmail(email))
{ alert("Invalid email address");
return false;
}
if (password.length < 8)
{ alert("Password must be at least 8
characters"); return false;
}
function isValidEmail(email) {
// A simple email validation using a regular expression
var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
return emailPattern.test(email);
}
</script>
</body>
</html>
Output
Program 16
Implementing a Java Script program to implement onClick and onSubmit
event.
<!DOCTYPE html>
<html>
<head>
<title>onClick and onSubmit Events
Example</title> </head>
<body>
<h1>onClick and onSubmit Events Example</h1>
<script>
// Function for onClick event
function changeText() {
var clickExample = document.getElementById("clickExample");
clickExample.innerHTML = "Button clicked!";
}
alert("Form submitted with Name: " + name + " and Email: " + email);
}
</script>
</body>
</html>
Output
Program 17
Creating a Java Script program to implement Dialog, Confirm and
Message Popups Boxes.
<!DOCTYPE html>
<html>
<head>
<title>Popup Boxes Example</title>
</head>
<body>
<h1>JavaScript Popup Boxes Example</h1>
<script>
// Function to display an alert
box function showAlert() {
alert("This is an alert box!");
}
Output
Program 19
Write a program in PHP to display the sum of two numbers.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-
scale=1.0"> <title>Document</title>
</head>
<body>
<form method="post" action="">
Enter the first number: <input type="text" name="num1"><br>
Enter the second number: <input type="text" name="num2"><br>
<input type="submit" value="Add">
</form>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$num1 = $_POST["num1"];
$num2 = $_POST["num2"];
Output
Program 20
Write a program in PHP to perform file handling.
<!DOCTYPE html>
<html>
<body>
<?php
// reads the first line of the file and displays it.
$myfile = fopen("Demo.txt", "r") or die("Unable to open file!");
echo fgets($myfile);
fclose($myfile);
?>
</body>
</html>
Output
Demo.txt