HTML Image
HTML image tag is represented by <img>. It is a single tag. The <img> tag is used for showing images in the HTML document.
Here src is the attribute of <img> tag. It refers the source of the image. There are some other attributes for <img> tag.
- alt attribute
- width attribute
- height attribute
- align attribute
- border attribute
The alt Attribute
The alt attribute describes the alternative text for the image. It means when the image is not displayed into the website for any reason then the text will be showed there.
The width Attribute
The width attribute fixes the width of the image. For changing the default width of the image width attribute is used.
The height Attribute
The height attribute fixes the width of the image. For changing the default height of the image height attribute is used.
The align Attribute
The align attribute changes the alignment of the image. For changing the alignment of the image align attribute is used. The value of align attribute can be left, right or center.
The border Attribute
The border attribute specifies the border size of the image. But the attribute isn't supported in HTML 5. Instead of HTML5 it is used in css.