Learn how to create hyperlinks, or anchors, in HTML with the help of W3Schools. Anchors are essential for navigating a web page or jumping to specific sections within a long document.

W3Schools, renowned for its interactive tutorials, offers a comprehensive guide on HTML anchors. Let's dive into their step-by-step instructions to create and target anchors.

Understanding HTML Anchors
The HTML anchor tag, <a>, is used to create hyperlinks. The href attribute specifies the link's destination. Here's a basic syntax:

<a href="#target sections">Link</a>
Anchor Syntax Breakdown

The.href attribute accepts a URL or a reference to an anchor within the same page. The target="_blank" attribute can be used to open the link in a new tab.
Here's an example: <a href="https://example.com" target="_blank">Example</a>
Using Anchors to Create Section Links

Anchors can also link to named sections within the same page. First, create an anchor using the id attribute. Then, create a link to it:
<h2 id="section1">Section 1</h2>
<p><a href="#section1">Go to Section 1</a></p>

Target Attribute for Anchors
The target attribute specifies where to open the linked document. It can take several values:




















Self or _self
Opens the link in the same tab or frame as the current one. This is the default value.
Blank or _blank
Opens the link in a new tab or window.
Parent or _parent
Opens the link in the parent frame. If there is no parent frame (or the frame is already at the top level), it acts like _self or blank.
Top or _top
Opens the link in the full body (or full window, if no frames).
Start exploring HTML anchors today! Try changing the target attribute values to see how they affect the linked content's location. Happy coding!