HTML Links: Definition, Syntax, Hyperlinks
An HTML link allows us to navigate from one page to the other page. HTML links are called hyperlinks. When You will click on a link and can jump to another page.
HTML Links – Syntax
The HTML <a> tag defines a hyperlink. the syntax is:
<a href=”Enter URL Here”> EducateBee.Com </a>
href attribute, which defines the link’s destination. Text inside the <a> tag is displayed on the screen and When you will take the mouse over a link, the mouse arrow will turn into a little hand.
Example:
<a href="https://www.educatebee.com/"> EducateBee.Com </a>
HTML Colors Links
Usually, The links appear as follows:
- An Unvisited link – blue and underlined.
- A Visited link – purple and underlined.
- An Active link – red and underlined.
We can change these link’s color with other colors are per requirement. here is a Example:
<style>
a:link {
color: red;
}
a:visited {
color: blue;
}
a:hover {
color: green;
}
a:active {
color: purple;
}
</style>
HTML Links Target Attribute
Usually, the linked page is opened in the same browser window. however, we can change this. to do this, you will have to define another target attribute value for the link. Target attribute values are:
| _blank | Opens the document in the new window/tab |
| _self | Opens the document in the same window/tab |
| _parent | Opens the document in the parent frame |
| _top | Opens the document in the full body of the window |
Example:
<!DOCTYPE html>
<html>
<body>
<h2>The target Attribute</h2>
<a href="https://www.educatebee.com/" target="_blank"> Visit EducateBee.Com to Learn HTML!</a>
</body>
</html>
HTML Image Links
You can insert an image link easily. for this, you will insert an image () tag in the place of text in the text link.
<h2> HTML Image Links: EducateBee </h2>
<img src="Prepareexams.jpg" alt="EducateBee"/>
HTML E-mail Links (Linking to an Email Address):
You can also use mailto: email address in the anchor tag. it will let you send a new email through a link.
Example:
<!DOCTYPE html>
<html>
<body>
<h2>HTML E-mail Links - EducateBee </h2>
<p><a href="mailto:EducateBee@example.com"> Click to Send Email </a></p>
</body>
</html>


HTML Comment Tags