In HTML, images are defined with the <img> tag. The <img> tag is empty, which means that it contains attributes only, and has no closing tag.
Following is the simple syntax to use this tag.
<img src="http://www.blogger.com/img/logo40.png" alt="Blogger" border="1" width="150px" height="40" />
This will produce following result:
Following are most frequently used attributes for <img > tag
- width: sets width of the image. This will have a value like 150px or 10%etc..
- height: sets height of the image.
- border: sets a border around the image.
- alt:It is an alternative text that will appear if the image is missing.
- align: This sets the horizontal alignment of the image and takes the value either to the left, right or center.
No comments:
Post a Comment