HTML Links

HTML Links:

Links are used to connect different web pages and resources .

Creating a Basic Link:

Use the <a> tag:

 Enclose the link text within <a> and </a> tags.

Specify the link destination with the href attribute:

Set the href attribute to the URL you want the link to point to.

Example:

<a href=”https://www.luckyithub.com”>Visit my website</a>

Clicking this link will open the page “https://www.luckyithub.com” in the browser.

Additional Features:

Link Target: Control how the linked page opens using the target attribute:

_self: Opens in the same window or tab (default).

_blank: Opens in a new window or tab.

_parent: Opens in the parent frame.

_top: Opens in the full body of the window.

Example:

<a href=”https://www.luckyithub.com” target=”_blank”>Open in a new tab</a>

HTML Email Links:

 

Email Links: Use mailto: for email links.

Phone Links: Use tel: for phone links.

Example:

 

<a href=”mailto:info@example.com”>Email us</a>

<a href=”tel:+1234567890″>Call us</a>

Join Our Newsletter