The HTML tag for inserting images on web page is <img>. Using img tag we can insert images from our website source or from external source. To define the source of images, img tag uses an attribute src. The syntax of img tag is <img src="source of image here">.
As we can see from above syntax of img tag that it does not have an ending tag. Img tag is like line break tag <br> where there is no need to use the closing tag, but rather we use a forward slash to close the tag.
<img src="my_image.jpg" />
<img src="http://www.cramerz.com/images/cramerz_logo.gif" />
Image tag comes with a number of attributes. We have used one attribute so far - src. Lets use some other attributes of <img>
Align attribute is for aligning an image left, right, center; bottom, top, middle
<img src="my_image.jpg" align="right" />
<img src="my_image.jpg" align="left" />
Ever wondered how to put a border around an image? Well its really simple. By just adding a border attribute to image tag we can have our nice borders around an image. The border of an image is specified by a numeric value mostly in pixels (px), for example border=2px
<img src="my_image.jpg" border="1px" />
<img src="my_image.jpg" border="3" />
<hr>
Inserts a horizontal rule
<hr size=?>
Sets size (height) of rule
<hr width=?>
Sets width of rule, in percentage or absolute value
<hr noshade>
Creates a rule without a shadow
all rights reseverd by Cramerz.com©. web development by
web design company
DotPeak. hosting by HostBay
all contents on cramerz are the property of Cramerz.com. web design courses