HTML Links
HTML links are Hyperlinks. When we move the mouse over a link, the mouse arrow will turn into a little hand.
On clicking the link we can route to another document or another website or another page or image, that is a link re-routes us to a different page.
A link can be an image or any other HTML element.
Syntax:<a href=”URL”>link text</a>
<!DOCTYPE html>
<html>
<body><h3>URL</h3>
<p><a href=”https://www.google.com/">Google</a></p>
</body>
</html>
By default,
An unvisited link is underlined and blue
A visited link is underlined and purple
An active link is underlined and red in any browser.
Get Suseendra’s stories in your inbox
Join Medium for free to get updates from this writer.
We can display the link without underlining by setting the value of the text-decoration attribute to none.
<!DOCTYPE html>
<html>
<body><h3>URL</h3>
<p><a style=”text-decoration:none” href=”https://www.google.com/">Google</a></p>
</body>
</html>
Syntax: <img src=”image.jpg” alt=” ”> or <img src=”URL” alt=” ”>
An image can also be given as a link.
Using mailto: inside the href attribute, we can create a link that opens the user’s email program.
<a href=”mailto:someone@example.com”>Sends email</a>
To use an HTML button as a link, we have to add some JavaScript code
Syntax:<button onclick=”document.location=’default.asp’”>HTML</button>
<!DOCTYPE html>
<html>
<body><p>Click the button to go to the Google web page.</p>
<button onclick=”document.location=’https://featurepreneur.com/'">HTML Tutorial</button>
</body>
</html>
On clicking the button, it will re-route to the featurepreneur website as shown below.
Thank you for Reading!!







