ADDING IMAGES ADVANCE ATTRIBUTES
In previous lesson we learned some basic HTML codes to add an image inside an article or comment box and also in webpages. Now, we are moving a little further in image manuplation.
Image Size Attributes
I have seen some images inside comment box exceeds the size of the body of comment box and hides under the advertisements. There is a solution which will resize the image to fit in the comment box. Below is the code to resize the image.
<img src=http://imageshack.us/myimage.jpg width="150" height="110">
"width and height" are called size attibutes, these attributes are included in the "img" tag to tell the brower to resize the image to given size on load.
See the example below:

Original Size of the Image Resized Image
Height= 240 Width= 196 Height= 150 Width=150
Image Border Attribute
'Border attribute' is included into "img" tag to draw a border around the image, that makes the image to look highlighted and beautiful.
<img src=http://imageshack.us/myimage.jpg border = "1">
border ="1" this will add a 1-pixel border around the image. Border pixel value can be increased. border ="0" means no border.
See the example below:

1- pixel border 0-pixel border 2-pixel border
Image Space Attributes
You can create space between the image and surrounding text by defining vertical and horizontal space.
<img src=http://imageshack.us/myimage.jpg vspace="5" hspace="10">
See the example below:
Space attributes with alignment attribute.
Alignment Attributes justify the image to the LEFT, RIGHT or CENTER of the webpage.
<img src=http://imageshack.us/myimage.jpg align = "LEFT">
Alignment attributes
align = "LEFT" to position the image to left
align = "CENTER" to position the image in the middle
align = "RIGHT" to position the image to the right
These align attributes also affect the text position, see above image and text position.
<img src=http://imageshack.us/myimage.jpg hspace ="10" vspace="5" align = "RIGHT">
See the text position now and image is aligned to right side of the page.
I hope, it will be proved as an essential lesson for beginners. Please, rate this tutorial.
Write to me for your questions and comments anytime.
Thanks for reading.


Comments: 27
Thanks Sigriet
Thanks you Dear Chip, you are always supportive to me.
Yes, Sharon you will find some more on HTML. Thanks
Toni-- Perhaps, but I cannot figure out what is wrong with my HTML article, even gather guides have never responded on this isse.
I use my own thoughts and idea, even the my own English what I know.
Maybe, someone don't want us to write tips and tricks.
I am hopeful, this would not happen to my next article.
TLC
Adding image into a webpage, it is good to know, how to do this.
I am happy you learned something. Thanks
Shah
Thanks...
I'll try to add some more lessons...
;)
Thanks a lot Tina...
Thanks very much Bhawana, I'll do so as I am pretty busy these days...
Cool, I'll make a note for the future -- thanks so much Syed!
danke schoen for the lesson
Syed, you are doing a very useful service here--well done.
I am so happy that you friends have shown great interest in learning HTML...
Hope you have found it easy... Thank you all friends...
Thanks, this is good information.
Great info and nicely explained. I know a bit of basic html, but since I don't use it much, I've probably forgotten most of it. :)