Links allows users to jump on another page, it is base element of every HTML website. This links are in HTML terminology called Hyperlinks.
<a href="url">Some text</a>
Links can be used also on images, paragraphs and on any HTML tag / element.
<a href="https://codedocs.org">Go to CodeDocs.org</a>
Target attribute tells where to open link
_self- default attribute, don't need to add if we want display webpage in current browser tab
_blank- usually open a new tab, but users can configure browsers to open a new window instead.
_parent- the parent browsing context of the current one. If no parent, behaves as
_top- the topmost browsing context (the "highest" context that’s an ancestor of the current one). If no ancestors, behaves as
Please see below how to target attribute use
<a href="https://codedocs.org" target="_blank">Go to CodeDocs.org and open in new tab</a>
In href attribute you can write E-Mail address and after you click on link it will open E-Mail client. Also when you type telephone number into href attribute it will directly call that number when you click at that link on smartphone.
<a href="mailto:[email protected]">Send E-Mail</a> <a href="tel:+421904102101">Call someone</a>
By: Tomas Silny
Edited: 2020-11-07 19:31:31