Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 21

Web Technologies

Lab experiments
Directorate of Distance Education, Kurukshetra University

Submitted By: Tapsvi Kumar Vasudev Shri Krishna Murti

Class: Master of Computer Application-III


Roll No.: 2307611702 Reg No.: 18-DDK-48
Ref. No.: 23244009

Submitted To: Department of Comp. Sci. & Applications, K.U.K


1. Write a HTML program for the demonstration of Lists.
e. Unordered List
f. Ordered List
g. Definition List
h. Nested List
Unordered List:
<html>
<head>
<title> Creating Unorder List </title>
</head>
<body bgcolor=”pink”>
<h1 align=”center”> Creating Unorder List</h1>
<h1 align=”center”>List of Colleges in Kurnool</h1>
<ul type=”square”>
<li>GPREC</li>
<li>RGMCET</li>
<li>GPCET</li>
</ul>
</body>
</html>
Output:
Ordered List:
<html>
<head>
<title> Creating Order List </title>
</head>
<body bgcolor=”pink”>
<h1 align=”center”> Creating Order List</h1>
<h1 align=”center”>List of branches in RGMCET</h1>
<ol type=”A”>
<li>CSE</li>
<li>IT</li>
<li>ECE</li>
<li>EEE</li>
<li>CIVIL</li>
<li>ME</li>
</ol>
</body>
</html>
Output:
Definition List:
<html>
<head>
<title>Creating Definition List</title>
</head>
<body bgcolor=”pink”>
<h1 align=”center”>Definition List</h1>
<dl>
<dt>CSE<dd>Computer Science & Engineering
<dt>ECE<dd>Electronics & Communication Engineering
<dt>IT<dd>Information Technology
<dt>EEE<dd>Electrical & Electronics Engineering
<dt>CE<dd>Civil Engineering
</dl>
</body>
</html>
Output:
Nested List:
<html>
<head>
<title>Nested Lists</title>
</head>
<body bgcolor=”pink”>
<h1 align=”center”>List of Colleges in Kurnool</h1>
<ol>
<li>Kurnool</li>
<ul>
<li>GPREC</li>
<li>BITS</li>
<li>GPCET</li>
</ul>
<li>Nandyala</li>
<ul>
<li>RGMCET</li>
<li>SREC</li>
</ul>
</ol>
</body>
</html>
Output:
2. Write a HTML program for demonstrating Hyperlinks.
c. Navigation from one page to another.
d. Navigation within the page. Navigation
from one page to another:
<html>
<head>
<title>Setting Hyperlink colors</title>
</head>
<body bgcolor="pink" link=”green” vlink=”blue” alink=”red”>
<center><h1>Setting Hyperlink colors</h1>
<a href=”login.html”>Click here</a>to goto login page
</body>
</html>
Output:
Navigation within the page:
<html>
<head>
<title>Nested Lists</title>
</head>
<body bgcolor="pink">
<center><h1>Linking to a section in a page</h1>
<a name=”top”>This is the top of the page</a>
Click here to goto the <a target=”#bottom”>bottom</a>of the page
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br>
<a name=”bottom”>This is the bottom of the page</a> Click here to goto
<a target=”#top”>top</a>of the page
</center>
</body>
</html>
Output:
1. Write a HTML program for time-table using tables.
<html>
<head>
<title>Timetable</title>
</head>
<body>
<h1 align="center"><font color="Salmon">Timetable of III
CSE</font></h1><br>
<table align="center" border="2" cellspacing="0" cellpadding="15">
<tr align="center" valign=="middle">
<th>DAY</th>
<th>I</th>
<th>II</th>
<th
rowspan="7"><b>T<br>E<br>A<br><br>B<br>R<br>E<br>A<br>K</b></th>
<th>III</th>
<th>IV</th>
<th
rowspan="7"><b>L<br>U<br>N<br>C<br>H<br><br>B<br>R<br>E<br>A<br>K</ b></th>
<th>V</th>
<th>VI</th>
<th>VII</th>
</tr>
<tr align="center">
<th>MON</th>
<td>IS</td>
<td>WT</td>
<td>SEM</td>
<td>OOAD</td>
<td>SCI</td>
<td>C#</td>
<td>COMP</td>
<tr align="center">
<th>WED</th>
<td>WT</td>
<td>IS</td>
<td>C#</td>
<td>SCI</td>
<td colspan="3">MOOC'S</td>
</tr>
<tr align="center">
<th>THU</th>
<td>IS</td>
<td>LIB</td>
<td>OOAD</td>
<td>WT</td>
<td colspan="3">WT Lab</td>
</tr>
<tr align="center">
<th>FRI</th>
<td>AP</td>
<td>AP</td>
<td>C#</td>
<td>OOAD</td>
<td colspan="3">C# Lab</td>
</tr>
<tr align="center">
<th>SAT</th>
<td>OOAD</td>
<td>SCI</td>
<td>WT</td>
<td>SEM</td>
<td>AP</td>
<td>AP</td>
<td>C#</td>
</tr>
</table>
</body>
</html>
Output:
3. Write a HTML program to develop a static Registration Form.
<html>
<head>
<title>Registration</title>
</head>
<body bgcolor=lightblue>
<h1 align=center><u>Registration Form</u></h1>
<br><br><br>
<div>
<strong>
First Name &nbsp <input type=text value=" " name="txt1"><br><br> Last Name
&nbsp <input type=text value=" " name="txt2"><br><br> UserName &nbsp <input
type=text value="" name="txt3"><br><br> Password &nbsp <input type=password
value="" name="pwd1"><br>
Confirm Password &nbsp <input type=password value="" name="pwd2"><br><br> Address
&nbsp <textarea rows=3 cols=60></textarea><br><br>
Date of Birth &nbsp dd<select
name="sel1">
<option>--</option>
<option>01</option>
<option>02</option>
<option>03</option>
<option>04</option>
<option>05</option>
<option>27</option>
<option>28</option>
<option>29</option>
<option>30</option>
<option>31</option>
</select>
mm<select name="sel2">
<option>--</option>
<option>01</option>
<option>02</option>
<option>03</option>
<option>04</option>
<option>05</option>
<option>06</option>
<option>07</option>
<option>08</option>
<option>09</option>
<option>10</option>
<option>11</option>
<option>12</option>
</select>
yyyy<select name="sel3">
<option>----</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>
<option>2011</option>
<option>2012</option>
<option>2013</option>
<option>2014</option>
<option>2015</option>
<option>2016</option>
<option>2017</option>
</select><br><br> Sex &nbsp
<input name="rb1" type="radio" value="radiobutton">Male
<input name="rb1" type="radio" value="radiobutton">Female
<br><br>
Martial Status &nbsp
<input name="rb2" type="radio" value="radiobutton">Single
<input name="rb2" type="radio" value="radiobutton">Married
<br><br>
Mobile Number &nbsp <input type=text name="txt4"><br><br> Branch &nbsp
<input name="rb3" type="radio" value="radiobutton">CSE
<input name="rb3" type="radio" value="radiobutton">IT
<input name="rb3" type="radio" value="radiobutton">ECE
<input name="rb3" type="radio" value="radiobutton">EEE
<input name="rb3" type="radio" value="radiobutton">MECH
<br><br>
Languages Known &nbsp
<input name="cb1" type="checkbox" value="checkbox">English
<input name="cb1" type="checkbox" value="checkbox">Telugu
<input name="cb1" type="checkbox" value="checkbox">Hindi
<input name="cb1" type="checkbox" value="checkbox">Kannada
<input name="cb1" type="checkbox" value="checkbox">Tamil
<br><br>
<center>
<input type=submit value="SUBMIT" name="btn1">&nbsp
<input type=reset value="CANCEL" name="btn1">
</center>
</strong>
</body>
</html>

Output:
4. Write HTML for demonstration of cascading stylesheets.
d. Embedded stylesheets.
e. External stylesheets.
f. Inline styles.
Embedded stylesheets:
<html>
<head>
<title>Embedded Style sheets</title>
<style type=”text/css”>
body{backgroun d-color:
pink;}
h1
{color:orange; text-align:
center;

}
p{
font-family: "Times New
Roman";
font-size: 20px;
}

</style>
</head>
<body>

<h1>Embedded Style Sheets</h1><br>


<p>This is a paragraph
</body>

</html>
Output:

External Stylesheets:
extern.css:
body {background-color: #d0e4fe;} h1 {
color: orange; text-align: center;
}
p{
font-family: "Times New Roman"; font-size: 20px;
}
External .html:
<html>
<head>
<title>External Style Sheets</title>
<link rel=”stylesheet” type=”text/css” href=”extern.css”>
</head>
<body>
<h1>External Style Sheets</h1><br>
<p>This is a paragraph
</body>
</html>

Inline styles:
<html>
<head>
<title>HTML Tables</table>
</head>
<body bgcolor=‟pink‟>
<center>
<h1>Creating HTML Tables</h1><br>
<table border=”2” cellpadding=”4” cellspacing=”4”>
<tr>
<th colspan=”2” style=”background-color:red”> WebSites</th>
</tr>
<tr>
<th style=”background- color:blue”>MailSites</th>

<th style=”background- color:green”>JobSites</th>


</tr>
<tr>

<td style=”background-color:grey”>Gmail</td>
<td style=”background-color:aqua”>Naukri</td>
</tr>
<tr>
<td style=”background- color:yellow”>Yahoo</td>
<td style=”background- color:purple”>JobStreet</td>
</tr>
</table>
</center>
</body>
</html>
Output:
5. Write a program to display contents of XML file in a table using Extensible Style Sheets ?
Book.xml:
<?xml version="1.0"?>
<?xml:stylesheet type="text/xsl" href="book.xsl"?>
<book>
<bookinfo>
<title>C</title>
<authorname>Balaguru Swamy</authorname>
<isdnno>1234</isdnno>
<publisher>pearson</publisher>
<edition>4th</edition>
<price>$50</price>
</bookinfo>
<bookinfo>
<title>c++</title>
<authorname>Balaguru Swamy</authorname>
<isdnno>5678</isdnno>
<publisher>technical</publisher>
<edition>3rd</edition>
<price>$100</price>
</bookinfo>
</book>
Book.xsl:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" omit-xml-declaration="no"/>
<xsl:template match="/">
<html>
<head>
<title>Book</title>
</head>
<body>
<center>
<table border="1" bgcolor=”grey”>
<thead >
<tr>
<th>title</th>
<th>authorname</th>
<th>isdnno</th>
<th>publisher</th>
<th>edition</th>
<th>price</th>
</tr>
</thead>
<xsl:for-each select="book/bookinfo">
<tr>
<td style="background-color:pink"><xsl:value-of select="title"/></td>
<td style="background-color:red"><xsl:value-of select="authorname"/></td>
<td style="background-color:green"><xsl:value-of select="isdnno"/></td>
<td style="background-color:purple"><xsl:value-of select="publisher"/></td>
<td style="background-color:brown"><xsl:value-of select="edition"/></td>
<td style="background-color:yellow"><xsl:value-of select="price"/></td>
</tr>
</xsl:for-each>
</table>
</center>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Output:
Test Formatting

<!DOCTYPE html>
<html>
<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>
<p>This is <sup>superscripted</sup> text.</p>
<p>This is <sub>subscripted</sub> text.</p>
<p>My favorite color is <del>blue</del> <ins>red</ins>.</p>
<p>My favorite color is <del>blue</del> red.</p>
<p>Do not forget to buy <mark>milk</mark> today.</p>
<small>This is some smaller text.</small>
<em>This text is emphasized</em>
<i>This text is italic</i>
<strong>This text is important!</strong>
<b>This text is bold</b>
<pre>
My Bonnie lies over the ocean.

My Bonnie lies over the sea.

My Bonnie lies over the ocean.

Oh, bring back my Bonnie to me.


</pre>
<p>This is<br>a paragraph<br>with line breaks.</p>

<h1>This is heading 1</h1>


<p>This is some text.</p>
<hr>
<h2>This is heading 2</h2>
<p>This is some other text.</p>
<hr>
</body>
</html>

You might also like