HTML Links

HTMLWeb DevelopmentFront End Technology

The HTML Links are hyperlinks that means when you click on a link, it jump son another document.


Following is the syntax −

<a href=”URL” target=”value” >Link Content</a>

Here URL specifies the destination address and it can be either local or external address. target attribute defines where to open the linked document and it can take the following values:

_blankIt opens the linked document in a new tab or window.
_parentIt opens the linked document in the parent frame.
_selfIt opens the linked document in the same window.
_topIt opens the linked document in the full body of the window.


Let us see an example of HTML Links −

Live Demo

<!DOCTYPE html>
   body {
      color: #000;
      height: 100vh;
      background-color: #8BC6EC;
      background-image: linear-gradient(135deg, #8BC6EC 0%, #9599E2 100%);
      text-align: center;
<h1>HTML Links Demo</h1>
<a href="" target="_blank">Go To Google</a>


Now click on “Go To Google” link to open google link in a new window.

Updated on 17-Feb-2021 05:17:17