<A href = "Destination_Page">Text/Image as anchor <A>
where "href" stands for Hyper reference.
This is the code showing the use of anchor tag.
<HTML>
<BODY>
This is the link to <A href = "http://www.vijaykamat-html.blogspot.com">My Blog</A>
</BODY>
</HTML>
You may also notice that the text also changes color and is now underlined. This can be changed to any other color using the FONT tag:
<HTML>
<BODY>
This is the link to
<A href = "http://www.vijaykamat-html.blogspot.com">
<FONT Color = "Black">My Blog</FONT>
</A>
</BODY>
</HTML>
The other aspects can also be changed, like for example we can add a little special effect, and for that we need styles, which is explained here: http://vijaykamat-html.blogspot.com/2011/02/css-styling-and-html.html
Linking within the same page:
Often you will require to provide links to traverse within the same web page. For example, when user reaches the end of the page may be you want to provide a link to the top of the page. This can easily be done with NAME attribute of the Anchor tag. Lets take an example. Below you can see a page where the top of the page is marked with a name. Later the text "Top" is linked to this area so a click takes user to the top of the page.
<HTML> <BODY> <A Name = "Top"> <Font Face = "Verdana" Size = "2">This is the top of the page.</Font> <BR><BR><BR><BR><BR><BR><BR><BR><BR><BR> <BR><BR><BR><BR><BR><BR><BR><BR><BR><BR> <BR><BR><BR><BR><BR><BR><BR><BR><BR><BR> <A href = "#Top">"Top"</A> </BODY> </HTML>
Web Page:
Notice how the name must start with a "#" symbol when used in Anchor tag.
No comments:
Post a Comment
Please leave a comment if you have anything to say or have something to ask.. I will do my best to answer..