ca*********@yahoo.com (J. VerSchave) wrote in
news:c5**************************@posting.google.c om:
I have a bunch of images that are
600x800
800x600
640x480
480x640
I want to use HTML to contrain the size of these images. I basically
want to display them as thumnails. Here is what I am trying to do:
"Display a thumbnail of this image, contraining the largest of the two
dimensions to 100 pixels and set the other dimension to the proper
relative size, scaled appropriately."
I dont want to actually resize the images, I just want them to be
displayed smaller. Is there an easy way to do this with HTML? With
CSS?
You can but you really, really, *really* shouldn't. What you're trying to
do is often called "dumbnailing." Especially in photo-gallery situations,
it *sucks*. First of all, all the "dumbnails" take just as long to load as
the full-size images. If, say, you have a gallery of 20 50K photos, you
have to load a whole megabyte just to see the thumbnails. Secondly, most
browsers do a *terrible* job of rescaling images by more than a few
percent. Dumbnails almost always look *severely* distorted. Finally,
dumbnailed pages often really badly slow down browsers; just scrolling or
navigating becomes extremely slow.
That said, dumbnails can be "achieved" by merely setting the height and
width of an image, in either HTML or CSS, to something smaller than the
image's actual dimensions. But the results are going to be *far* from
satisfactory, and if you want your visitors to have a good experience with
your site, you will want to create true thumbnails. Don't inconvenience
all your visitors just to save yourself a little bit of time or learning.