If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

HTML: The a tag

The <a> tag is used both for linking to other websites and for linking to parts of the current webpage. It has one required attribute:
  • href: Where the browser should navigate to. If it should go to a new page, then this should be a URL starting with "http://" or "https://". If it should jump inside the current page, then it should start with a "#" and then match the id attribute of the tag to jump to (like "#main").
The a tag should contain whatever the browser should make clickable. That's often text, but it could also be an image or any collection of tags.

Want to join the conversation?

No posts yet.