HTML Links

 HTML Links - Use an Image as a Link

To use an image as a link, just put the <img>tag inside the <a> tag:


<html>

<body>

<h2>Image as a Link</h2>

<p>The image below is a link. Try to click on it.</p>

<a href="https://docxlsppt.blogspot.com/p/html.html"><img src="smiley.gif" alt="HTML" style="width:42px;height:42px;"></a>

</body>

</html>


Button as a Link

To use an HTML button as a link, you have to add some JavaScript code.

JavaScript allows you to specify what happens at certain events, such as a click of a button:


<html>

<body>

<h2>Button as a Links</h2>

<p>Click the button to go to the HTML .</p>

<button onclick="document.location='https://docxlsppt.blogspot.com/p/html.html'">HTML</button>

</body>

</html>



Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.