Sara Haradhvala wrote:
thanks! i specify the sizes in the CSS for groupings of images that
are all the same size (e.g. tthumbnails in a carousel or image
gallery) and was just wondering if that is the correct thing to do.
It's OK. You don't even have to specify the dimensions at all, but doing so
lets the browser allocate space for the image before getting the image data.
So it's a speed of rendering issue, and also a matter of avoiding
unnecessary movements on the page (which may happen, especially when
connections are slow, if the browser has started rendering the page, then
notices that it gets some image data and needs to insert the image, causing
subsequent elements to be repositioned).
Setting the dimensions in HTML has the advantage of taking effect even when
CSS is disabled in the browser. This is usually a minor advantage, and when
you have a large number of equally-sized images, using CSS is more
convenient.
--
Yucca, http://www.cs.tut.fi/~jkorpela/
______________________________________________________________________
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/