Jump to: navigation, search

HTML images link

From w3cyberlearnings

Contents

HTML - Img tag with URL

Click on the image it opens a new window. You can assign the link to the text file or URL in the <a>'s attribute.

Example 1 TRY-IT

<html>
<head>
<title>Click Image open a new  URL</title>
</head>
<body>
<a href="http://w3cyberlearnings.com">
	<img src="myhome.png" width="120" height="80"/>
</a>
</body>
</html>

Output

Html image url 1.png

Example 2 TRY-IT

  • Open a text file.
<html>
<head>
	<title>Click Image open text</title>
</head>
<body>
	<a href="mytext.txt">
		<img src="myhome.png" width="120" height="80"/>
	</a>
</body>
</html>

Output

Html image url 2.png

Related Link



Navigation
Web
SQL
MISC
References