What is an External Link?
An External Link is a link that takes users from one website to another, just like going from one house to another in real life.
Developers use external links to connect their webpages to webpages on other websites.
Syntax:
<a href="https://www.google.com">Visit Google</a>
Syntax with Attributes
<a href="https://www.google.com" target="_blank" title="Visit Google">Visit Google</a>
<a
href="https://www.google.com"
target="_blank"
title="Visit Google">
Visit Google
</a>
↑
↑
↑
↑
href
Which website?
Which website?
target
Where to open?
Where to open?
title
Extra information
Extra information
Visit Google
Clickable text
Clickable text
Example:
<a href="https://www.youtube.com" target="_blank" title="Open YouTube">Open YouTube</a>
➤ Know more about target attribute .
List of Common Important Attributes
- href — Specifies the URL or destination of the link.
- target — Specifies where to open the linked page.
- title — Provides extra information about the link.
- download — Tells the browser to download the linked resource when supported.
- rel — Specifies the relationship between the current page and the linked resource.
- hreflang — Specifies the language of the linked document.
- type — Gives information about the type of linked resource.
Note: An external link takes users from one website to another website.
How to Create an External Link to Another Website
You can create an external link by following these steps.
- First, open the HTML page where you want to add the link.
- Then, use the
<a>tag to create the external link. - Next, add the full URL of the other website in the
hrefattribute. - Write the clickable link text between the opening and closing
<a>tags. When users click the text, the other website opens. - You can also use the
styleattribute to change the link's appearance, such as its color, font size, or background.














