Page 115 - TP_Plus_v2.2_Class_8
P. 115
The <A> tag has the following attributes:
HREF: HREF stands for Hypertext Reference. It takes the URL of the web page which we want to link
when we create external linking.
TARGET: This attribute is used to specify the place at which the linked web page will open. It takes
any one of the following four values:
_blank: Opens the linked web page in a new window or tab of the web browser.
_parent: Opens the linked web page in a parent window or tab of the web browser.
_self: Opens the linked web page in current window or tab.
_top: Opens the linked web page in the window that is on top in all the windows.
External web pages can be linked using HREF attribute of the anchor tag. The HREF attribute takes the
URL of the web page in double quotes. The syntax to create a hyperlink is:
<A HREF = "URL of Web Page" TARGET="_blank"> Link Text </A>
For example:
<A HREF = "About.html" target="_blank"> About Us </A>
The preceding code will create a link with the name About Us. When we click on the About Us link, the
About.html web page will open in a blank tab or window.
First page of a website, also known as Home page, contains various links of other web pages. Let us
take an example of a website of the ABC Public School in which we are using external linking. The
Home page of the website is as shown:
Output
This web page contains six hyperlinks: Admissions, Events, Sports, Activities, About Us and Contact
Us, which are created by using the <A> tag.
The code to create the Home.html web page is as follows:
<!DOCTYPE HTML>
<HTML>
<HEAD>
<TITLE> Home Page </TITLE>
Images, Links and Frames in HTML5 113

