0% found this document useful (0 votes)
21 views2 pages

Start Declare Open Add Open Create Create Create Create Create Create Close End

The document provides an HTML program demonstrating the use of hyperlinks with various attributes such as href and target. It includes sections for a basic hyperlink, a hyperlink that opens in a new tab, an email link, and a link to a section within the same page. The program is structured with appropriate HTML tags and headings to explain each type of hyperlink clearly.

Uploaded by

devan.bharathi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views2 pages

Start Declare Open Add Open Create Create Create Create Create Create Close End

The document provides an HTML program demonstrating the use of hyperlinks with various attributes such as href and target. It includes sections for a basic hyperlink, a hyperlink that opens in a new tab, an email link, and a link to a section within the same page. The program is structured with appropriate HTML tags and headings to explain each type of hyperlink clearly.

Uploaded by

devan.bharathi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

1. Write a HTML program, to explain the working of hyperlinks using tag and href, target Attributes.

ALGORITHM:
 Start the program.
 Declare the HTML document <!DOCTYPE html>.
 Open the <html> tag with an attribute lang="en".
 Add the document's metadata within the <head> tag:
 Open the <body> tag to start the content.
 Create the main heading <h1> with the text "Hyperlink Example".
 Create a section for basic hyperlink:
Create a section for hyperlink with target attribute
Create a section for hyperlink to an email address:
Create a section for hyperlink to a section within the same page:
Create Section 1 for the hyperlink reference:
1. Close all the tag.
End of the program.

PROGRAM :
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hyperlink Example</title>
</head>
<body>
<h1>Hyperlink Example</h1>

<!-- Basic Hyperlink -->


<h2>Basic Hyperlink</h2>
<p>Visit <a href="https://www.example.com">Example Website</a> for more
information.</p>

<!-- Hyperlink with Target Attribute -->


<h2>Hyperlink with Target Attribute</h2>
<p>Open <a href="https://www.example.com" target="_blank">Example Website</a> in a
new tab.</p>

<!-- Hyperlink to an Email Address -->


<h2>Hyperlink to an Email Address</h2>
<p>Send an email to <a
href="mailto:[email protected]">[email protected]</a>.</p>

<!-- Hyperlink to a Section within the Same Page -->


<h2>Hyperlink to a Section within the Same Page</h2>
<p>Go to the <a href="#section1">Section 1</a> below.</p>

<!-- Section 1 -->


<h2 id="section1">Section 1</h2>
<p>This is Section 1.</p>
</body>
</html>
OUTPUT :
Hyperlink Example
Basic Hyperlink
Visit Example Website for more information.
Hyperlink with Target Attribute
Open Example Website in a new tab.
Hyperlink to an Email Address
Send an email to [email protected].
Hyperlink to a Section within the Same Page

You might also like