Resizing Images in HTML

Resizing

We can change the size of an image using the width and height attributes. In general, it is not advisable to reduce image size using these settings, since the image will transferred over the Internet in its original size no matter what reduction is set for it. This will slow the loading of our web page. This means, that if we have an image that is bigger in size than we want it to be on our page, we should reduce the size in a graphics program, rather than reducing the size on the web page using the width and height attributes.

On the contrary, sometimes, it cab be wise to enlarge images using this technique.

Below are two setting of images using width and height attributes:


<img src="http://www.yahoo.com/rainbow.gif" width="60" height="60">



<img src="http://www.yahoo.com/rainbow.gif" width="120" height="120">

If we leave out the settings for width and height, the browser will automatically use the real size of the image. However, we should always enter the settings for width and height, even when using the real size!

The reason is that if the settings are left out, the browser can not build the page until the image is loaded entirely. This means, that the visitor cannot read text around the image while the image itself is loading - which in turn will give the visitor an impression of a slow loading page. This becomes especially true if the image is inside a table. In that case, the whole table will not be shown until the image is loaded entirely.

Comments

0 Responses to "Resizing Images in HTML"

Post a Comment

Your feedback is always valuable for us :

About Me

My photo
Vision :- "To be a reputed institution of Smart People who Add Value Across Generation". Mission :- We are dedicated to Spreading Literacy in Society and Helping People choose Value for Money Products for Better Living.We are also adding health awareness and wellness to the society of India." We are distributor and promotors of India's Largest IT products Direct Selling Company with a reach of more than 250 cities nationwide. We have a strong internet R&D base to bring out cost effective and Quality products.