Images in HTML

Valid values for id attribute

In html document, images are added via img element where the src attribute contains the url to the image path.

Images example:

<img src=”image.jpg”>

There are different types of image format like jpg, png, gif, bmp etc.
There is a attribute called “alt” which is used to give alternate information about the image or in case if image is missing.

<img src=”image.jpg” alt=”Flower image”>

You can change the height or width of the image using height and width attribute:

<img src=”image.jpg” alt=”Flower image” width=”40″ height=”30″>

To align image to right or left or other options use align attribute:

<img src=”image.jpg” alt=”Flower image” align=”right”>

Leave a Reply

Your email address will not be published. Required fields are marked *