How to create links in HTML

To create a link in HTML, you use the anchor tag,

<a>

The href attribute is used to specify the web address (URL) of the page you want to link to.

Here is an example of how to create a link:

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

This will display “Visit Google” as a hyperlink, and when clicked, the user will be taken to the Google homepage.

Opening links in a new tab:

You can open links in a new tab by using the target attribute. The value “_blank” will open the link in a new tab.

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

This will open the Google homepage in a new tab when clicked.

Linking to a section within the same page:

If you want to link to a specific section within the same page, you can use the ID attribute to specify the section.

<a href="#section1">Jump to Section 1</a>

...

<h2 id="section1">Section 1</h2>

This will create a link that, when clicked, will jump down to the section with the ID of “section1”.

Linking to an email address:

You can also use the anchor tag to create a link that will open a user’s email client with the recipient already filled in.

<a href="mailto:example@email.com">Send me an Email</a>

This will display “Send me an Email” as a hyperlink, and when clicked, the user’s email client will open with the recipient already filled in as “example@email.com”.

Linking an external resource with target blank:

<a href="https://www.bbc.com/" target="_blank">Visit BBC</a>

This link will open the BBC homepage in a new tab when clicked.

  Written by: Maria Jensen     27-05-2023     Written in: HTML tutorials

12 Comments

  • Anthony says:

    I found this tutorial really helpful! I’ve been trying to figure out how to create links in HTML and this page explained it in a clear and concise manner . The step-by-step instructions, along with the code examples, made it so easy to understand. I appreciate that they also included some additional tips and best practices. I feel much more confident now in my ability to create links in my webpages. Thank you!

  • Molly says:

    Wow, this tutorial on how to create links in HTML is exactly what I needed! I’ve been struggling to understand how to incorporate links into my website, but this guide broke it down in such a clear and concise way . The step-by-step instructions, along with the examples, made it super easy for me to follow along. I appreciate how beginner-friendly the content is, as it didn’t assume any prior knowledge. Thanks to this tutorial, I now feel confident in adding links to my HTML pages. Keep up the fantastic work!

  • Ariana says:

    I found this tutorial on BeginnerTuts for creating links in HTML quite informative . The step-by-step instructions were straightforward to follow. However, I noticed that the examples provided in the tutorial were a bit outdated. It would have been more helpful if they included some modern and practical use cases for creating links. Overall, the content was decent, but I believe it could be improved by incorporating more updated examples.

  • Serenity says:

    Great tutorial! I’ve always struggled with creating links in HTML, but your step-by-step instructions made it so simple to understand . Now I can easily connect my web pages together. The examples provided were extremely helpful in solidifying my understanding. Thanks for sharing these valuable tips!

  • Jackson says:

    This tutorial iz super helpful! I’ve been strugling with creating links in HTML, but this guide made it so much easier to understand . Thank you for this!

  • Braden says:

    This tutorial was extremely helpful! I’ve been trying to figure out how to create links in HTML for a while now, and this guide explained it in such a simplified way that even a beginner like me could understand it . The step-by-step instructions, along with the clear examples, made the learning process super easy. I’m so glad I stumbled upon this page! Now I feel confident enough to create links on my web pages without any trouble. Thanks a lot for this valuable resource!

  • Scarlett says:

    This tutorial was super helpful in understanding how to create links in HTML! I was able to follow along easily and now feel confident in adding links to my web pages . Thanks for the clear explanations and examples!

  • Elena says:

    This tutorial was super helpful for me as a beginner in HTML! I always struggled with creating links, but now I feel much more confident thanks to this guide . Can’t wait to practice and improve my skills even more. Thank you!

  • Zoey says:

    I found this tutorial extremely helpful in understanding how to create links in HTML . The step-by-step instructions were clear and easy to follow. Thank you for this great resource!

  • Martin says:

    I found this tuturial very helpful! The step by step instractions made it easy to understand how to create links in HTML . Thank you for sharing this informaion!

  • Alejandro says:

    This tutorial was incredibly helpful in teaching me how to create links in HTML! I have been struggling with this for a while, but now I feel much more confident . Thank you for the clear and easy-to-follow instructions!

  • Juan says:

    This tutorial was super helpful in learning how to create links in HTML! 🙌 I feel much more confident in my coding skills now . Thanks for the clear explanation!

Leave a Reply

Your email address will not be published. Required fields are marked *