DEV Community

Charity Parks
Charity Parks

Posted on

HTML Links

If you want to add a link to another website in your website, or if you want to add an email link on your website then this is the post for you!

Using HTML to create links we need to use the <a>element. Add the website link that you want to direct to inside the <a>link text</a>. Link text tells them what they are linking to. You will use href attribute to add the actual link.

For example...
<a href="http://www.kohls.com">KOHLS</a>

KOHLS tells the user where they are being directed to. They can now click any where in the link text to be forwarded to www.kohls.com.

To insert an email link on your website you also use the <a>and href.

For example...
<a href="mailto:mary@gmail.com">Email Mary</a>

Happy Coding!!!

Top comments (1)

Collapse
 
istealersn profile image
Stanley J Nadar

Nice work Charity, also explore the attribute target for anchor tag, it will help apply logics to meet Marketing or Accessibility requirements too