HTML IMAGES

                                       HTML Images


Images are showing in web pages using <img>.We can use image format like .png,.gif,.jpeg,.jpg.

The <img> is an empty tag.It contains attributes only ,and doesn't contain closing tag.
"src" attribute is used to specify the image source.
<img src="url">
alt Attribute
 "alt" attribute value describe the image in words if the image is not displayed.The alt attribute is required in a web page that will not validate correctly without it.
<img src="html.gif" alt="html icon">

Image Width and Height
We can use Width and Height attributes to specify the height and width of the image .It can do in two ways ,using style attribute we can specify width and height in pixel.
<img src="html.gif" alt="html icon" style="width:128px;height:128px">
Or we can directly specify width and height.
<img src="html.gif" alt="html icon" width="128" height="128">
Using style attribute is preferable,It prevents styles sheets from changing the default size of images.

0 Comment "HTML IMAGES"