In this tutorial, we will talk about what is hyperlink and what it can do in the HTML web page. In web page, a hyperlink is a link from a hypertext document to another location. To be straight forward, a hyperlink is a HTML links. The hyperlink are widely use today, you ca find the hyperlink any where in the internet. Hyperlink is not just a text, it can be a picture too.
Create Your First Hyperlink
So, basically we use
<a href="URL"> tag to create a hyperlink. For example.
<a href="https://jorcus.com/">CLICK ME TO VISIT JORCUS.COM</a>
From the code above, we defined the URL in
href="URL" as my website www.jorcus.com. When you click on the link, it will redirect yo to the www.jorcus.com
Open Link in New Window
If you’d like to open the link in new window, we use
target attribute to achieve this.
So, if you’d like to open link in new window. We need to set the
target attribute to
_blank. Here’s the example code.
<a href="https://jorcus.com/" target="_blank">Visit JORCUS.COM in new Window</a>
To understand more what you can do with
_self: By default, the hyperlink are set as
_self. It will redirect the link for current window.
_blank: Open link in new window or new tab.
_top: Open link in the full body of the window
_parent: Open link in the parent frame
You can also create a hyperlink for a local link (
without https://www.). For example.
<a href="blog.html">Go to Blog</a>
If you want to create a email hyperlink, you can set
<a href="mailto:[email protected]">Contact Me</a>
For phone, you can use
<a href="tel:+1586-666-6643">Contact Me</a>