How Can I Make A Picture Larger Or Smaller Using
Just HTML?
This one is actually quite simple.
All we do is change the values in the Height and Width attributes
of the IMG
tag. The image below is actually 1200x 1600 pixels. Too large for
almost any monitor. But in the first instance I have set the
Height at 160 and the Width at 120. In the second view the image size
is set to Width 150 Height 200.
Be mindful of the fact that you do need to keep the aspect ratio the
same for each value. You can easily get your image out of skew. I
simply divided 1600 by 10 and 1200 by 10 also to get the 160 by 120, I
used * to divide the height and width for the second example. Divide the
height and width by 5 and we get 320 x 240 as in the third example. All
three images are the same the only thing that has changed is the size
we have set it to using HTML.
It is a very good idea to always set the WIDTH and HEIGHT VALUES in all
your HTML documents even if you are leaving them the same size as the
image on your web host. This is important because many browsers can not
show anything until they know where all the pieces of your page align
For this example I have intentionally left out the
alt image info. In actual use we would want to place our alternate text
for your image in between the two quotation marks after alt. alt="place alternate text here".
This is very important for sight challenged users. Plus it has the
added benifit of being indexed by most search engines when ranking your
page.