Contents
Anchor
An anchor is an HTML tag that marks a specific point in an HTML document as either the source or destination of a hypertext link. This allows you to create links from one hypertext document to another, as well as to different sections within the same document.
On the Web, you probably recognize anchors as the different colored text you click to go to another website. For instance, term “HTML” above is an anchor. If you click on it, it will take you to our glossary definition for HTML (in case you were wondering what HTML means). On longer webpages, the author may decide to create anchors to different sections of that same page. This way, you don’t have to scroll through the entire page to find something three-quarters of the way down. In this case, anchor can also refer to the destination text that you end up at after click the link at the top of the page.
Also See: hyperlinks, link
Frequently Asked Questions
What is the difference between an anchor and a link?
An anchor is essentially the container for a link. It’s the text or image that a link is embedded into. For example: Google. In this example, the word Google is the anchor. The address it takes you to (http://www.google.com) is the link. It’s hard to imagine one without the other, which is why anchors are sometimes referred to as anchor links.
There is one exception to this. When you use anchors to link to content on the same page, the place you wind up is also an anchor, even though it does not contain a link to anything.
Are anchors only for the Web?
Anchors are used for a variety of applications, but they are best known for their use on webpages. If you have ever read an eBook, the table of contents is full of anchors. When you click on a chapter in the table of content, you are taken to that chapter in the book. The corresponding title or chapter heading is a destination anchor. Many PDF files and even MS Word documents work the same way, allowing you to create links to different pages or sections within the document. They may also contain links to external sources, such as a website.
Are anchors always a different color?
Most websites use a different color for their links, but other sites may only underline them. It’s even possible to make links that look exactly like the rest of the text on your page, but this is not a common practice, because it makes finding links very difficult. If a photo is used as an anchor, the only way you will know is by sliding your mouse over top of it.
Destination anchors do not have to be a different color. They do not contain links, so there is no reason to make them stand out from the rest of the text. However, since internal links are usually made to the section headings, they will probably be bold or stand out in some other way.