What are HTML Links?

Print anything with Printful



HTML anchors, represented by the letter “A”, allow users to click on elements and be directed to URLs. They can be customized with HTML formatting and CSS extensions. Anchors are used to move between pages or marked locations within a page. They can also define or navigate to sections of an HTML document. Anchor tags enclose visual elements and change color when hovered over. The use of anchors to define locations within a document is deprecated, and IDs should be assigned via CSS to block-level tags instead.

Since the inception of HyperText Markup Language (HTML) being used online, HTML anchors have remained one of the primary interactive elements used in nearly every web page. HTML anchors are a type of tag represented by the letter “A” that allows a user to click on an element and be directed to a universal resource location (URL) such as another web page or a different section within the within the same HTML document. It is more common to refer to HTML anchors as links or hyperlinks. Similar to many other HTML tags, anchors can be customized with both standard HTML formatting properties and Cascading Style Sheet (CSS) extensions.

Within a web page, HTML anchors are used to move a user from one page to another or to other marked locations within the same page. The anchor is represented by the letter “A” at the beginning of the tag. When navigating between web pages, the destination URL address is assigned to the hypertext reference (href) property, although this too can be an image, a program, or almost any type of content. The default behavior of an anchor is to open the new URL in the same browser window, replacing the current content, although this behavior can be changed to open URLs in new windows or in targeted frames on a page.

The second use for HTML anchors is to define or navigate to sections of the displayed HTML document. By naming the anchor tag via the name property, an anchor is created in the document that can be referenced elsewhere. Just like navigating to another web page, the anchor tag can be used to navigate to an anchor on the same page once defined, allowing for the creation of a table of contents or table of contents.

When HTML anchors are used, the tag itself has no visual representation, but instead must enclose the visual elements that will be used to represent it. The anchor tag can wrap text, images, or entire formatted blocks. By default, visual HTML elements surrounded by anchor tags are underlined and colored differently, depending on whether the link was visited by the user. Anchor text also changes color when the mouse hovers over it, although this too can be changed.

The use of HTML anchors to define locations within a single document has been depreciated and should not be used except to maintain legacy code. Instead, anchor positions within a document should be defined by assigning an identification (ID) via CSS to block-level tags, such as headers. The anchor tag can, however, still be used to jump to these locations via a link.




Protect your devices with Threat Protection by NordVPN


Skip to content