Page 95 - CodePilot V5.0 C7
P. 95
The uses of different values of the target attribute:
_blank: It opens the link in a new window.
_parent: It opens the linked document in a parent frame.
_self: It opens the linked web page in the current window or tab. It is the default value for the
target attribute.
_top: It opens the linked document in the window that is on top in all the windows.
The syntax for using the <A> tag is as follows:
<A HREF="URL" TARGET="VALUE">LINK CONTENT</A>
Code Write the HTML code to present the given web page using the <A> tag to create an
1 internal hyperlink.
<!DOCTYPE HTML>
<HTML>
<HEAD>
<TITLE>Famous Cities</TITLE>
</HEAD>
<BODY STYLE="BACKGROUND-COLOR: #FAFAD2; COLOR: #2F4F4F;">
<H1>Explore Famous Cities Around the World</H1>
<P><A HREF="#paris">Go to Paris</A></P>
<P><A HREF="#london">Go to London</A></P>
<P><A HREF="#tokyo">Go to Tokyo</A></P>
<P><A HREF="#newyork">Go to New York</A></P>
<H2 ID="paris">Paris</H2>
<P>Paris is known as the "City of Light" and is famous for the Eiffel
Tower.</P>
<H2 ID="london">London</H2>
<P>London is the capital of the UK and is home to landmarks like Big
Ben and the Tower of London.</P>
<H2 ID="tokyo">Tokyo</H2>
<P>Tokyo is the bustling capital of Japan, known for its skyscrapers,
shopping and culture.</P>
<H2 ID="newyork">New York</H2>
<P>New York is famous for the Statue of Liberty, Times Square and
Central Park.</P>
</BODY>
</HTML>
93
Making Web Pages Alive

