HTML Image Link Code
<img src="url" alt="some_text"/>
1.In HTML, images are defined with the <img> tag.
In order to add an image to web page, you need to specify the image location with <img> tag. Also you have to specify the extension of image name, like jpg, gif, jpeg, png.
The browser displays the image where the <img> tag occurs in the document. If an image tag is put between two paragraphs, the browser shows the first paragraph, then the image, and then the second paragraph.
The <img> tag is empty, which means that it contains attributes only, and has no closing tag.
2.To display an image on a page, it needs to use the src attribute. Src stands for "source".
The URL points to the location where the image is stored. An image named "image1.gif", located in the "images" directory on "www.aspell.org" has the URL: http:// www.aspell.org /images/image1.gif.
3.The alt attribute specifies an alternate text for an image, if the image cannot be displayed. It also helps in SEO.
The text of the alt attribute should be meaningful for SEO.
Example: 1
Output
I have inserted 2 animated gif file here.
Add an image as a link to a web page.
Example: 2
<html>
<head>
</head>
<body>
<a href ="http://Aspell.org"> <img src="button.gif"/></a>
</body>
</html>
<head>
</head>
<body>
<a href ="http://Aspell.org"> <img src="button.gif"/></a>
</body>
</html>
No comments:
Post a Comment