<?xml version="1.0" encoding="utf-8"?>

Imagine a web without links—it would be a fragmented maze with isolated pockets of information, devoid of the interconnectedness that defines the online experience.

With the ability to effortlessly navigate users to different pages, external resources, or specific sections within a document, links are the backbone of user-friendly and interactive web design.

Learn how to implement links effectively to create a dynamic and engaging website and explore the realm of link attributes, empowering you to customize link behavior, optimize accessibility, and enhance the overall user experience.

Exercise #4

_Blank value

_Blank value

While the href attribute defines the link destination, the target attribute tells the browser where to open the linked document. For example, the link can lead users to a new window or tab, which is how it's most commonly used. To make it work, use the _blank value and keep in mind that the target name should start with an underscore (_) character: <a href="URL" target="_blank">Link text</a>.

Exercise #5

_Self value

_Self value

Most browsers open links in the same window or tab by default, for example, when you click an image to see it in full size. In this scenario, the target attribute has a value of _self, and the notation looks like this: <a href="URL" target=”_self”>link text</a>.

Exercise #6

Absolute URL

Absolute URL

Remember, the URL tells the browser where it can find a file — an HTML page, image, or program on a local or networked computer. You have 2 options when it comes to the selection of URLs: absolute URL and relative URL. The absolute URL shows the full path to the target: the protocol (HTTPS), the domain name, including the location within your website in your folder system.[1]For example, it may look like this: <a href="https://www.example.com/form.php">.

Absolute URLs are more tedious to create as they require you to describe the entire route. However, their main advantage is preventing content duplication and increasing the chance that users won't miss updated content.

Exercise #7

Relative URL

Relative URL

Simply put, relative URLs are condensed versions of absolute URLs. Instead of showing the full web address, they only contain the location following the domain.[2] An example of a relative URL is: <a href="/file.html">. To make it easier for you, remember that relative URLs never contain the https://www part. Also, they are the preferred choice of web developers as relative URLs are less time-consuming to compose.

Pages with relative URLs have a slightly better loading time than those using absolute URL paths.

Exercise #8

Mailto: value

Mailto: value Bad Practice
Mailto: value Best Practice

One usability rule says that products should attempt to anticipate users' wants and needs. When scanning a page for a person's email, users might want to contact this person right away. To make it more convenient and reduce users' efforts, designers and developers can turn an email label into a link. To make this work, place the mailto: inside the href attribute. It'll create a link that opens users' email programs so that they can send an email.[3]

Complete this lesson and move one step closer to your course certificate