This website may use cookies. More info. That's Fine x
Welcome Login

a tag (anchor tag)


Html

The anchor <a> tag is used to create hyperlinks and bookmarks.

Web page or site:

<a href="/folder/page">

 

Open to a new browser page:

<a href="/folder/page" target="_blank">

 

 

Local page:

<a href="pagename.html">

 

Local page in a folder level below:

<a href="foldername/pagename.html">

 

Local page in a folder level above:

<a href="../pagename.html">

 

 

Open email program with email address:

<a href="mailto:andrewsin@rocketmail.com">

 

 

Bookmarked section:

<a href="#bookmarkname">

 

Eg:

<!-- link to bookmark -->
<a href="#moreinfo">Click here for more info</a>

<!-- this is the bookmark -->
<a name="moreinfo">More Info</a>

 

Bookmarked section in another page:

<a href="pagelocation.htm#bookmarkname">

 

 

To stop an anchor link from a page reload in asp.net:

Try:

<a href="#" onclick="return false;">link</a>

Created on: Friday, September 30, 2011 by Andrew Sin