Sunday, October 10, 2010

HTML Images

The images are very important to beautify and representative of many concepts to your web page. Its is true that a picture is worth thuasands words. So, as a web developer, you should have a clear understanding on how to use images in your web pages.

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:
Blogger

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