HTML Lab Programs-1 PDF
HTML Lab Programs-1 PDF
COMPUTER SCIENCE
Lab Programs
Experiment -1:
Source Code:
<html>
<head>
</head>
<body bgcolor="yellow">
<center>
</center>
<hr color="cyan">
</h1>
<center>
U.G</b></u> </font>
</center>
<center>
<br>
                       
 
 
</font>
<br>
</font>
<br>
</sub></font>
                       
 
 
<b>                  Lecture </b>
</font>
<br>
</font>
                       
 
 
<b>                  Lecture </b>
</font>
<br>
</font>
                       
 
 
<b>                  Lecture </b>
</font>
<br>
</body>
</html>
Output:-
Experiment-2:-
(a)Ordered List (b) Unordered List (c) Nested List (d) Image
Source Code:
<html>
<head>
<title> List of colleges </title>
</head>
<body>
<font size=8 color=orange><center> Yogi Vemana University </center></font>
<font size=5 color=orange><center>Vemanapuram, Kadapa</center></font>
<hr size=5 width=1000 noshade>
<h3><u> Affiliated Colleges</u></h3>
<ol>
<li><b> Sahithya Degree & PG College </b></li>
<ul>
<li> Bachelor of Science </li>
<ol>
<li>Bzc</li>
</ol>
<li> Bachelor of Computer Science </li>
<ol>
<li> MScs </li>
<li> MPCs </li>
</ol>
<li> Bachelor of Commerce </li>
<ol>
<li> BCOM-C.A </li>
</ol>
<li> Master of Commerce </li>
</ul>
<br>
<li><b> Sri Venkateshwara Degree & PG College </b></li>
<ul>
<li> Bachelor of Science </li>
<ol>
<li>Bzc</li>
<li>Mpc</li>
</ol>
<li> Bachelor of Computer Science </li>
<ol>
<li> MScs </li>
<li> MPCs </li>
</ol>
<li> Bachelor of Commerce </li>
<ol>
<li>Bcom - General </li>
<li> BCOM-C.A </li>
</ol>
<li> Bachelor of Arts </li>
<ol>
<li> BA-HEP</li>
<li> BA-Telugu </li>
</ol>
<li> Master of Commerce </li>
<li> Master of Mathematics </li>
<li> Master of Computer Science </li>
</ul>
<br>
Output:
Experiment-3:-
Aim: Create a Table with four rows and five columns. Place an image in one column.
Source code:
<html>
<head><title>Person Table</title></head>
<body><h1>"Person Table"</h1>
<table border="3" align="center">
<tr>
<th>Sno</th>
<th>Name</th>
<th>Address</th>
<th>Gender</th>
<th>Image</th>
</tr>
<tr>
<td>1</td>
<td>Jack Austin</td>
<td>France</td>
<td>M</td>
<td><img src="https://cdn.pixabay.com/photo/2015/05/02/11/54/justin-timberlake-
749860__340.jpg"
alt=" " height=100 width=100/></td></tr>
<td>2</td>
<td>John Doe</td>
<td>United States</td>
<td>M</td>
<td height=100 width=100>
<img src="https://cdn.pixabay.com/photo/2015/05/02/11/54/justin-timberlake-
749860__340.jpg"
alt=" " height=100 width=100/></td></tr>
<tr>
<td>3</td>
<td>Smith</td>
<td>France</td>
<td>M</td>
<td>
<img src="https://cdn.pixabay.com/photo/2015/05/02/11/54/justin-timberlake-
749860__340.jpg"
alt=" " height=100 width=100/></td></tr>
<tr>
<td>4</td>
<td>Jessy</td>
<td>India</td>
<td>F</td>
<td>
<img src="https://cdn.pixabay.com/photo/2016/11/29/20/22/girl-1871104__340.jpg"
alt=" " height=100 width=100/></td></tr>
</table>
</body>
</html>
Output:
Experiment – 4:
Source Code:
<html>
<head>
<title> Using table tag</title>
</head>
<body>
<center>
<table width="800" height="500" align="center">
<tr>
<td width="250">
<img src="C:\Users\HP\Desktop\2021 Bcom CA\imge\first.jpg" height="150" width="220">
</img>
</td>
<td width="250">
<img src="C:\Users\HP\Desktop\2021 Bcom CA\imge\second.jpg" height="250"
width="220">
</img>
</td>
<td width="300">
<img src="C:\Users\HP\Desktop\2021 Bcom CA\imge\third.jpg" height="150"
width="220">
</img>
</td>
<td width="300">
<img src="C:\Users\HP\Desktop\2021 Bcom CA\imge\fourth.jpg" height="150"
width="220">
</img>
</td>
</tr>
<tr>
<td>
<img src="C:\Users\HP\Desktop\2021 Bcom CA\imge\fifth.jpg" height="150" width="220">
</img>
</td>
<td colspan="2">
<font size="7"> buy <b> "Tweeties"</b> On_line</font>
</td>
<td>
<img src="C:\Users\HP\Desktop\2021 Bcom CA\imge\sixth.jpg" height="150"
width="220">
</img>
</td>
</tr>
<tr>
<td width="250">
<img src="C:\Users\HP\Desktop\2021 Bcom CA\imge\seventh.jpg" height="150"
width="220">
</img>
</td>
<td width="250">
<img src="C:\Users\HP\Desktop\2021 Bcom CA\imge\eight.jpg" height="150"
width="220">
</img>
</td>
<td width="300">
<img src="C:\Users\HP\Desktop\2021 Bcom CA\imge\nine.jpg" height="150" width="220">
</img>
</td>
<td width="300">
<img src="C:\Users\HP\Desktop\2021 Bcom CA\imge\ten.jpg" height="150" width="220">
</img>
</td>
</tr>
</table>
</center>
</body>
</html>
Output:
Experiment-5:
Source code:
<html>
<head>
</head>
<body>
<p> Menu</p>
<label> select cars</label>
<select>
<option value = “BMW”> BMW
</option>
<option value = “Mercedes”> Mercedes
</option>
<option value = “Audi”>Audi
</option>
<option value = “Skoda”> Skoda
</option>
</select>
</form>
</body>
<html>
Output:
Experiment-6:
Aim : Create a form using HTML which has the following types of controls: a)Text Box b)
Option/radio buttons c) Check box
d) Rest and Submit buttons.
Source Code :
<html>
<head><title> Customer Profile Entry Form</title>
</head>
<body>
<p align="center">
<font face=verdana size=7>CUSTOMER PROFILE ENTRY FORM</font>
</p>
<hr><hr><br>
<form method=post>
<table align="center">
<tr>
<td><font face=vyshnav size=2><b>Name
<td><input type=text size=35 name=name>
<tr><td><font face=vyshnav size=2><b>Address
<td><textarea rows=4 cols=30 name=address></textarea>
<tr><td><font face=vyshnav size=2><b>City
<td><input type=text size=35 name=city>
<tr><td><font face=vyshnav size=2><b>State
<td><input type=text size=35 name=State>
<tr><td><font face=vyshnav size=2><b>Postal Code
<td><input type=text size=35 name=postalcode>
<tr><td><font face=vyshnav size=2><b>Country
<td><input type=text size=35 name=country>
<tr><td><font face=vyshnav size=2><b>Phone
<td><input type=text size=35 name=phone>
<tr><td> <td>
<tr><td><font face=vyshnav size=2><b>E-mail
<td><input type=text size=35 name=email>
<tr><td><font face=vyshnav size=2><b>Date of Arrival
<td><input type=text size=35 name=arrival>
<tr><td><font face=vyshnav size=2><b>No. of Rooms
<td><input type=text size=35 name=no. of rooms>
<tr><td><font face=vyshnav size=2><b>No. of Persons
<td><input type=text size=35 name=no. of persons>
<tr><td><font face=vyshnav size=2><b>Name of the Hotel
<td><input type=checkbox value="Hotel Bhimas Paradise">Hotel Bhimas Paradise <br>
<input type=checkbox value="Hotel Bhimas">Hotel Bhimas
<tr><td><font face=vyshnav size=2><b>Types of Rooms
<td>
<input type=checkbox value="Double A/C Suite">Double A/C Suite <br>
<input type=checkbox value="Double Non A/C Suite">Double Non A/C Suite <br>
<input type=checkbox value="Single A/C">Single A/C <br>
<input type=checkbox value="Single Non A/C">Single Non A/C <br>
<tr><td><font face=vyshnav size=2><b>Mode of Payment
<td>
<select>
<option selected>Cash
<option>Cheque
<option>Credit Card
<option>Debit Card
<option>UPI
</select>
<tr><td><font face=vyshnav size=2><b>Remarks
<td>
<textarea rows=2 cols=20 name=remarks></textarea>
<tr>
<td><input type=submit value="submit">
<td><input type=reset value="Reset">
</table>
</form>
</body></html>
Output:
Experiment-7:
Source Code:
<html>
<head>
<style>
*{box-sizing:border-box;}
ul{list-style-type:none;}
body{font-family:verdana,sans-serif;}
.month{
padding:70px 25px;
width=100%;
background:#1abc9c;
text-align:center;
}
.month ul{
margin:0;
padding:0;
}
.month ul li{
color:white;
font-size;20px;
text-transform:uppercase;
letter-spacing:3px;
}
.month.prev{
float:left;
padding-top:10px;
}
.month.next{
float:right;
padding-top:10px;
}
.weekdays{
padding:10px 0;
background-color:#ddd;
margin:0;
}
.weekdays li{
display:inline-block;
width:13.6%
color:#666;
text-align:center;
}
.days{
padding:10px 0;
background:#eee;
margin:0;
}
.days li{
list-style-type:none;
display:inline-block;
width:13.6%;
text-align:center;
margin-bottom:5px;
font-size:12px;
color;#777;
}
.days li .active{
padding:5px;
background:#1abc9c;
color:white !important
}
@media screen and(max-width:720px){
.weekdays li, .days li{width 13.1%;}
}
@media screen and(max-width:420px){
.weekdays li, .days li{width 12.5%;}
.days li .active{padding:2px;}
}
@media screen and(max-width:290px){
.weekdays li, .days li{width 12.2%;}
}
</style>
</head>
</body>
<h1 align="center"> CSS Calender </h1>
<div class="month">
<ul>
<li class="prev"> ❮
August ❯ </li>
<span style="font-size:20px">2021</span> </li>
</li>
</ul>
</div>
<ul class ="weekdays">
<li>mon </li>
<li>tue</li>
<li>wed</li>
<li>thu</li>
<li>fri</li>
<li>sat</li>
<li>sun</li>
<ul class="days">
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
<li>7</li>
<li>8</li>
<li>9</li>
<li><span class="active">10</span></li>
<li>11</li> <li>12</li> <li>13</li> <li>14</li>
<li>15</li> <li>16</li> <li>17</li> <li>18</li> <li>19</li>
<li>20</li> <li>21</li> <li>22</li> <li>23</li> <li>24</li>
<li>25</li> <li>26</li> <li>27</li> <li>28</li> <li>29</li> <li>30</li> <li>31</li>
</ul>
</body>
</html>
Output :
Experiment-8:
Aim : Create an applet that accepts two numbers and perform all the arithmetic operations on
them.
Source Code :
<html>
<head>
<title>Simple calcularer using javascript </title>
<basefont size="5" face="airal">
<script language="javascript">
function add()
{
document.form1.result.value=parseInt(document.form1.first.value)+parseInt(document.form
1.second.value
);
}
function sub()
{
document.form1.result.value=parseInt(document.form1.first.value)-
parseInt(document.form1.second.value);
}
function mul()
{
document.form1.result.value=parseInt(document.form1.first.value)*parseInt(document.form1
.second.value
);
}
function div()
{
document.form1.result.value=parseInt(document.form1.first.value)/parseInt(document.form1.
second.value
);
}
</script>
</head>
<body bgcolor="#skyblue">
<form name="form1">
<h1 align="center">Simple Calculator</h1>
<table cellpadding="10" cellspacing="0" border="3" bordercolor="#red" align="center">
<tr><td> first number
<td><input type="text" size="30" name="first">
</tr>
<tr><td> second number
<td><input type="text" size="30" name="second">
</tr>
<tr><td> result
<td><input type="text" size="30" name="result">
</tr>
<tr><td>
<input type="button" value="+" name="xx" onClick="add()">
<input type="button" value="-" name="yy" onClick="sub()">
<input type="button" value="*" name="zz" onClick="mul()">
<input type="button" value="/" name="ww" onClick="div()">
<input type="reset" value="clear">
</tr>
</table>
</form>
</body>
</html>
Output :
Experiment-9:
Source Code :
<html>
<head>
<tittle>PERSONAL INFORMATION</tittle>
</head>
<body>
<hr>
</tr>
<tr><td>Father Name
</tr>
<tr>
<td>Gender
<td colspan="3">Male
</tr>
<tr><td>Date of Birth
<td colspan="3">18-Feb-2002
</tr>
<tr><td>Nationality
<td colspan="3">Indian
</tr>
<tr><td rowspan="5">Address</tr>
<tr><td colspan="2">Street/town:Neelapuram</tr>
<tr><td colspan="2">PhoneNo:8688716108</tr>
<tr align="center">
<th>Degree
<th>University/Institute
<th>Month&Year
</tr>
<tr>
<td>Degree
<td>2022
</tr>
<tr>
<td>Intermediate
</tr>
<tr>
<td>SSC
</tr>
</table>
</body>
</html>
OUTPUT :
Experiment-10:
Aim: Create a form that accepts the information from the subscriber of a mailing system.
Source Code:
<html>
<form name=frm>
<center>
</font>
<hr color=pint>
<tr><td>*select content:
<td><select style=”WIDTH:150px”>
<option>USA</option>
<option>switzerland</option>
<option>canada</option>
</select></td>
<tr>
<td>*Zipcode:
<td><input name=t5></td>
<tr>
<td>*Date of Birth:
<td>
<select>
<option >March</option>
<option >September</option>
<option >December</option>
</select>(mm)
<select>
<option>31</option>
</select>(dd)
<select>
<option selected>1982</option>
<option >1983</option>
<option >1984</option>
<option >1985</option>
<option >1986</option>
<option >1987</option>
<option >1988</option>
<option >1989</option>
<option >1990</option>
<option >1991</option>
<option >1992</option>
<option >1993</option>
<option >1994</option>
<option >1995</option>
<option >1996</option>
<option >1997</option>
<option >1998</option>
<option >1999</option>
<option >2000</option>
<option >2001</option>
<option >2002</option>
<option >2003</option>
<option >2004</option>
<option >2005</option>
<option >2006</option>
<option >2007</option>
<option >2008</option>
<option >2009</option>
<option >2010</option>
</select>(yyyy)
<tr><td rowspan=3>*Hobbies
</center></table></form></body></html>
Output:
Experiment-11:
<html>
<head><title> Tables</title></head>
<body>
</table>
</body>
</html>
Output :-
Experiment--12:
// open the notepad, type the below code and save as “frames.html”
<html>
<head><title>S.V.Arts College</title>
<frameset cols="20%,80%">
<frame src="a.html">
<frame src="b.html" name="right">
</frameset></head></html>
// open the notepad, type the below code and save as “a.html”
<html><body>
<h3><i>Courses Offered:</i></h3>
<h4><i><ul type="*">
<li><a href="BSC.html" target="right">B.Sc Courses</a><br><br>
<li><a href="BCOM.html" target="right">B.Com Courses</a><br><br>
<li><a href="PG.html" target="right">P.G Coursrs</a>
</ul></li></h4>
</body></html>
// open the notepad, type the below code and save as “b.html”
<html>
<body>
<h1 style="font-family:Arial Black;">
<center>S.V.ARTS COLLEGE</center>
</h1>
<hr><hr>
<br><br><br><br><br><br><br><br>
<center>
<img src="https://cdn.pixabay.com/photo/2015/07/31/11/45/library-869061__340.jpg"
width=500 height=300 border=5></img>
</center></body></html>
// open the notepad, type the below code and save as“bsc.html”
<html><body><h3><i>B.Sc Courses:</i></h3>
<hr>
<h4><i><ul type="*">
<li>B.Sc Biotechnology<br><br>
<li>B.Sc MSCS<br><br>
<li>B.Sc MECS
</ul>
<a href="b.html">Back To Home</a>
</i></h4></body></html>
// open the notepad, type the below code and save as “bcom.html”
<html>
<body>
<h3><i>B.Com Courses:</i></h3>
<hr>
<h4><i><ul type="*">
<li>B.Com Computer Science<br><br>
<li>B.Com General<br><br>
</ul>
<a href="b.html">Back To Home</a>
</i></h4></body></html>
Output:-
Experiment -13 :-
Aim :- To including different types of Style sheets
Source Code :-
// open the notepad, type the below code and save as “style1.html”
<html><head>
<title>style sheets</title>
<link rel="stylesheet" href="mystyle1.css">
<style type="text/css">
h1
{
font-family:"Times New Roman";
font-size:36px;
color:maroon;
}
h3
{
font-family:"Times New Roman";
font-size:36px;
background:#ffffff;
color:maroon;
text-align:center;
text-decoration:underline;
}
.p
{
font-family:arial,verdana,sans-serif;
font-size:20px;
background:#ffffff;
color:red;
}
p.style1
{
font-familly:arial,verdana,sans-serif;
font-size:16px;
background:#ffffff;
color:navy;
}
</style>
</head>
<body>
<h3>Different types of style sheets</h3>
<h1>This is an example for Internal style sheet</h1>
<p>This is a Normal paragraph</p>
<p class=style1>This is a paragraph with Arial font and 16px size</p>
<p style="color:#009900; font-size:50px;font-style:italic;text-align:center;">This is a
example for inline style sheet</p>
<h1 class=main>This is an example for External style sheet</h2>
</body></html>
mystyle1.css
body {
background-color:powderblue;
}
.main {
text-align:center;
}
Output :-
Experiment-14 :-
Aim :- To creating a static webpage in html
Source Code:-
Output :-
Experiment-15:
Source Code:
<html>
<title>Layer Effect Example</title>
</head>
<body>
LAYER 1 ON TOP :
<div style="position:relative;
font-size:50px;
z-index:2;">
LAYER 1
</div>
<div style="position:relative;
top:-50;
left:5;
color:gray;
font-size:80px;
z-index:1;">
LAYER 2
</div>
LAYER 2 ON TOP :
<div style="position:relative;
font-size:50px;
z-index:4;">
LAYER 2
</div>
<div style="position:relative;
top:-50;
left:5;
color:gray;
font-size:80px;
z-index:3;">
LAYER 1
</div>
</body></html>
Output: