Master AI & Build your First Coding Portfolio with SkillReactor | Sign Up Now

Lesson 2 - HTML Tags And Elements

2.5 Links

Links in HTML are essential for navigating between webpages. The <a> tag is used to create a link. The href attribute specifies the destination URL.

Basic Link Example

<a href="">Visit</a>

In the example above, <a> creates a link labeled "Visit". Clicking on it will navigate to the webpage specified by the href attribute (

Opening Links in a New Tab

To open a link in a new tab, use the target="_blank" attribute:

<a href="" target="_blank">Visit (opens in new tab)</a>

The target="_blank" attribute instructs the browser to open the linked webpage in a new tab or window.

By default, clicking on the link without the target attribute will navigate within the current tab or window.