HTML Links & Attributes
The Anchor Tag (<a>) is the essence of the "Web". It connects documents, creates navigation, and binds the internet together.
The Href Attribute
The most critical attribute. Without href, the tag is just a placeholder. It defines the destination address, which can be an absolute URL (like https://google.com) or a relative path (like /about.html).
Target Behavior
By default, links open in the same window. To keep users on your site while sending them to another, use target="_blank". Always pair this with rel="noopener noreferrer" for security.
Special Links
Links aren't just for web pages. Use mailto: to open email clients, or hash links (#section-id) to jump to specific parts of the same page.
View Full Transcript+
This module covers the syntax of the anchor tag, the distinction between absolute and relative URLs, the security implications of target blank, and the implementation of user-agent specific protocols like mailto.
