Scroll to top
Read Time: 3 min

The <a> element (or “anchor”) creates a hyperlink to webpages, files, and other resources, by passing a URL to its href attribute. It’s one of the most important elements of HTML, and one of the first you’ll get to know when starting out as a developer.



<a href="">Envato Tuts+</a>


Linking to Sections

Anchors can also link to sections on the same page by using fragment identifiers. This takes the form of a # symbol which points to the id of an element elsewhere on the page:

<a href="#somewhere">Jump somewhere else</a>
<h2 id="somewhere">This is somewhere else!</h2>
You can use #top or simply # to link directly to the top of the current page.

Browser Support

The <a> tag is supported in all modern browsers. Read more on


The <a> tag supports Global Attributes in HTML. Global Attributes are common to all HTML elements and can be used on all of them (though they may not have much of an effect on some of them).

  • If the <a> element has an href attribute, then it represents a hyperlink labeled by its contents.
  • If the <a> element has no href attribute, then the element represents a placeholder for where a link might otherwise have been placed.

The href Attribute

The <a> element supports the following attributes which can only be present if the href attribute is present:


An <a> element allows for transparent content, but there must be no interactive content descendant, <a> element descendant, or descendant with the tabindex attribute specified.


Wherever possible, make link text descriptive, rather than simply saying “click here”. For more information check out Emma Patricios’ article on creating valid and accessible links (see what I did there?).

  • The <link> element is also a type of hyperlink, but instead of being used to navigate HTML documents and files, it’s used to define a relationship between them.
  • The <base> element is related in that it provides the base URL for all relative URLs within a document.

Learn More

Did you find this post useful?
Want a weekly email summary?
Subscribe below and we’ll send you a weekly email summary of all new Web Design tutorials. Never miss out on learning about the next big thing.
Looking for something to help kick start your next project?
Envato Market has a range of items for sale to help get you started.