Links are necessary for users to jump from one page to another or inside the same page. An anchor element <a> is used to define a link.

Link can be:

A link does not have to link to another HTML file, it can link to any file anywhere on the web.


Link Syntax

The basic structure of a link element is:

<a href="https://developer.mozilla.org/he/docs/Web/Tutorials">MDN tutorial website</a>

Link Attributes

Some of the common attributes used with a element are:

Base Element

For relative links the HTML <base> element can be used. It specifies the default base URL and the default target to use for all relative URLs contained within a document. There can be only one <base> element in a document.
The base element has to be written in the <head> section. For example:

<head>
    <base target="_blank" href="http://www.w3schools.com/images/">
</head>
<body>
    <img src="my-image.gif"  alt="#">
    <a href="http://www.w3schools.com">W3Schools</a>
</body>