DEV Community

Cover image for HTML Links
Rakshambika
Rakshambika

Posted on

HTML Links

What are HTML Links?

HTML links are used to connect one webpage to another webpage, section, file, email address, or external resource. Links are created using the anchor () tag and help users navigate through websites and web applications.

Syntax

<a href="https://www.example.com">Visit Example</a>

Attributes of the Anchor Tag

1. href

Specifies the destination URL.

<a href="https://www.google.com">Google</a>

2. target

Specifies where the linked document should open.

<a href="https://www.google.com" target="_blank">
    Open Google
</a>




Common values:

_self - Opens in the same tab (default)
_blank - Opens in a new tab
_parent - Opens in the parent frame
_top - Opens in the full window

3. title

Provides additional information when hovering over the link.

<a href="https://www.google.com" title="Search Engine">
    Google
</a>
Enter fullscreen mode Exit fullscreen mode

Top comments (0)