2023-2024
COMMERCE
Standard :XI Batch :- _______
Expt. Title :- Use Of Hyperlink on webpage Roll No :- _____
Expt.No :-4
Performed On :-_____________ Submitted On:- ________
Aim:Use Of hyperlink on webpage.
Write a program using HTML with the following specification.
A webpage with details about a class with total number of students-100,
(Boys -50, Girls- 50) in tabular form.
e.g.
page1.html
Link this page to another page as follows.
page2.html
Software Requirements: Notepad, Internet Explorer.
1 | Page
2023-2024
Code:
page1.html
<!doctype html>
<html>
<head>
<title>Details of Div A Students</title>
</head>
<body bgcolor=grey text=white>
<center>
<h1> Class Details </h1>
<table border=2 width=70% bordercolor=red>
<caption> Div A</caption>
<tr>
<th>Total Number of Students</th>
<th>Boys</th>
<th>Girls</th>
</tr>
<tr align=center>
<td>100</td>
<td>50</td>
<td>50</td>
</tr>
</table>
<br><br>
<a href=page2.html>Page2</a>
</center>
</body>
</html>
Output:
2 | Page
2023-2024
page2.html
<!doctype html>
<html>
<head>
<title>Details of Div A Students</title>
</head>
<body bgcolor=cyan text=brown>
<b>STD-XI</b>
<br>
<i>Stream-Science</i>
<br>
<a href=page1.html>Div – A</a>
</body>
</html>
Output:
General Explanation about the Experiment:
Hyperlinks are used to connect one document with another document.
When you open any website and click on a text or an image it takes you to
that page. It is known as hyperlink.
In HTML, Links are created by using <a> tag.
3 | Page
2023-2024
Attribute of <a> Tag:
href: The href attribute is used to specify address of the file (URL) which
needs to be opened on clicking.
There are two types of hyperlink
1. Text hyperlink
Syntax :
<a href = page1. html> Click here for my page </a>
2. Image hyperlink :
Many websites have images as hyperlink.
Syntax :
<a href =page1.html>
<img src =arrow.gif alt = "Click on arrow">
</a>
HTML Link colours :
A hyperlink by default appears blue in colour with an underline.
An unvisited link is underlined and blue.
A visited link is underlined and purple.
An active link is underlined and red.
4 | Page