October 15, 2012

Using images in HTML


Just like you use texts in your HTML, we can also use images inside our HTML. Images help people to understand the idea of something with much more effect. This makes the web more beautiful with many graphical representations and much more designs to decorate the websites around the world.

Image element


<img src="=images.jpg" alt="Beautiful Image" height="300" width="500" />

The img element is used in HTML, to insert a image into a webpage. This tag denotes the browser the presence of image in a webpage.

"src" attribute

As the img tag denotes the presence of image to a browser, the src(source) attribute will tell the browser about the source of the image.

"height" and "width" attribute

By default, the browser displays the original size of the image. So that's why the height and the width attribute are much useful to the developers as they can resize the image accordingly to their webpage. Without these attributes, developers must face some hazardous work on images too.

"alt" attribute

The alt attribute is used for specifying the alternate text. It provides an alternative text when the image is not loaded or when users turn off the images on their browsers. This value can give an idea of what the image is.

No comments:

Post a Comment