
Hyperlinks are the foundation of the World Wide Web. They connect pages, guide users through websites, help search engines discover content, and turn static documents into an interconnected experience. Creating a link in HTML is simple, but using links correctly involves understanding URLs, attributes, accessibility, and SEO. In this guide you will learn how to make a web link in HTML, along with practical examples and best practices that professional developers follow.
Build Better-Connected Websites With AAMAX.CO
Thoughtful linking improves navigation, user experience, and search rankings. AAMAX.CO is a full service digital marketing company that offers web development, digital marketing, and SEO services worldwide. They plan logical site structures, implement clean navigation, and create internal linking strategies that help both visitors and search engines. Their website development services produce semantic, accessible HTML that follows modern standards.
The Anchor Element Basics
Links in HTML are created with the anchor element, written as the letter a. The most important attribute is href, short for hypertext reference, which specifies the destination. The text between the opening and closing tags becomes the clickable link text. A basic example is <a href='https://example.com'>Visit Example</a>. When users click the text, the browser navigates to the specified address.
Absolute URLs
An absolute URL includes the full address, including the protocol and domain, such as https://example.com/blog/article. Absolute URLs are required when linking to external websites. They always point to the same location regardless of where the current page is located, which makes them reliable for cross-site links and email content.
Relative URLs
Relative URLs point to resources on the same website without repeating the domain. For example, <a href='/about'>About Us</a> links to the about page from the root of the site, while <a href='contact.html'>Contact</a> links to a file in the same directory as the current page. Using two dots, as in ../index.html, moves up one directory level. Relative links make sites easier to move between development and production domains.
Opening Links in a New Tab
To open a link in a new browser tab, add target equal to _blank. When doing so, also include rel equal to noopener noreferrer, which prevents the new page from accessing the original window through JavaScript and improves security and performance. For example: <a href='https://example.com' target='_blank' rel='noopener noreferrer'>Example</a>. Use new tabs sparingly, mainly for external resources, and consider indicating this behavior to users.
Linking to Sections on the Same Page
You can link to a specific part of a page using fragment identifiers. First, give the target element an id, such as <h2 id='pricing'>Pricing</h2>. Then link to it with a hash symbol: <a href='#pricing'>See Pricing</a>. This technique is perfect for tables of contents, long articles, and single-page websites. You can also link to a section on another page by combining the URL and fragment, like /services#design.
Email and Phone Links
Special URL schemes trigger other applications. A mailto link opens the user's email client: <a href='mailto:hello@example.com'>Email Us</a>. You can pre-fill a subject using a query string. A tel link lets mobile users call with a single tap: <a href='tel:+15551234567'>Call Now</a>. These links are especially valuable on mobile-friendly business websites.
Download Links
Adding the download attribute tells the browser to download the linked file rather than open it, which is useful for PDFs, brochures, and resources. For example: <a href='/files/guide.pdf' download>Download the Guide</a>. You can provide a value to suggest a file name for the saved file.
Making Images Clickable
Any inline content can be wrapped in an anchor, including images. Place an img element inside an anchor to create a clickable image, such as a logo linking to the home page. Always include descriptive alt text on the image, because it serves as the link text for screen reader users.
Write Descriptive Link Text
Link text should clearly describe the destination. Avoid vague phrases like click here or read more, which provide no context to screen reader users navigating by links or to search engines evaluating relevance. Instead use descriptive text such as download the pricing guide or read our accessibility checklist. Good link text improves usability, accessibility, and SEO simultaneously.
Styling Links With CSS
Browsers display links in blue with underlines by default, but CSS lets you customize their appearance. Use the pseudo-classes :link, :visited, :hover, :focus-visible, and :active to style different states. Keep links visually distinct from surrounding text, preferably with an underline or strong contrast, and never remove focus outlines without providing a clear alternative for keyboard users.
Links and SEO
Internal links help search engines discover and understand your pages and distribute authority across your site. External links to reputable sources add credibility. Use the rel attribute values nofollow, sponsored, or ugc for paid, affiliate, or user-generated links as recommended by search engines. Regularly check for broken links, since they harm both user experience and rankings.
Conclusion
Knowing how to make a web link in HTML is one of the first and most important skills in web development. Use the anchor element with a valid href, choose between absolute and relative URLs appropriately, apply target and rel attributes thoughtfully, and write descriptive link text. With accessible styling and a smart linking strategy, your links will guide users smoothly and strengthen your site's visibility in search engines.