<a>

href attribute has the URL linking to other web page or resource. label is used to display information for web page visitors.


<a href="http://www.example.com">label</a>

Syntax for the anchor

Anchor name starts with #. It marks a linkable area inside a page. We can use anchor link to hyperlink to a specific part in a web page.


<a href="#anchorName">label</a>

Example


<html>/*w  w  w.j a v  a2  s  .  co  m*/
<body>
     <a name="top"></a>
     <a href="http://www.java2s.com">java2s.com</a>
     <a href="#par3">Go to paragraph #3 in this page</a>
     <p><a href="yourdocument.html#sty">
        Go to the yourdocument.htm page,sty location</a></p>
     <p><a name="par3">Paragraph #3</a></p>
     <p><a href="#top">Top</a></p>
</body>
</html>




















Home »
  HTML CSS »
    HTML CSS Reference »




HTML Tag Reference
CSS Reference
CSS Selector Reference
Encoding Reference