Adding images



Adding images to your web page
HTML let you display images in web page by using <img> tag. <img> tag doesn't have closing tag.

<img> tag :
Images can be inserted in web page by using <img> tag.
To display an image on a page, you need to use the src attribute. Src stands for 'source'. The value of the src attribute is the URL of the image you want to display on your page.
Following are the attributes of <img> tag:
Attributes DescriptionValues
align : Controls alignment of the image.top, bottom, middle, left, right
border : Sets the size of the border to be placed around the image. pixels
src : This is the main attribute of <img> tag.It contains URL of the image where image is located.URL
width : Controls width of the image.pixels, %
height : Sets height of the image.pixels, %
hspace : It indicates amount of space to be left at the left & right of the image.pixels
vspace : It indicates amount of space to be left at the top & bottom of the image.pixels
alt : It displays text when image fails to appear in the browser or when mouse pause over that image.text

The following eg. shows the use of <img> tag:

<img src="http://developthecode.googlepages.com/flower11.jpg">

Output :


Image as hyperlink
Image can be act as hyperlink in the following way:

<a href="prog101.blogspot.com"><img src="img src="http://developthecode.googlepages.com/flower22.jpg""></a>

Output :


0 comments:

 
Home

Copyright © 2009 Programming |Designed by Templatemo |Converted to blogger by BloggerThemes.Net | Reviewed by Blogger Templates