Web Links In HTML
The word Surfing is often used while discussing the internet which means moving from one web page to another. You can surf on the web using Links. Links are created using the HTML anchor tag <a>. An anchor is used in the following ways:
- Create links to access other pages on the same website
- Create a link to another website or page
- Create a link to send email
- Create a bookmark inside a web page
You define the link destination in the href attribute of the <a> element. The target attribute with the value _blank is used in the following example to open Amazon's website in a new window.
Using a shorthand known as relative URL, you can link to other pages within the same website and do not need to specify the domain name. The first four links in the previous example demonstrate relative URL.
When you link to a different website, the value of the href attribute will have the full web address for the site, which is known as an absolute URL as shown in the last link.
You can also create an image link in addition to text link.
Learn the HTML5 language in this tutorial series. These tutorials are designed for new programmers to provide them thorough knowledge of full stack web development.