Forum Moderators: open

Message Too Old, No Replies

Do you still specify widths and heights for images?

         

dtribble

8:18 pm on Mar 20, 2004 (gmt 0)

10+ Year Member



Hi all,

I've recently become a convert to using css to create mostly table-less designs which are standards compliant (Jeff Zeldman changed my life! :-)

I'm always trying to find good ways to make my code clean, lean and mean. I was wondering if you all still specify widths and heights in the your image tags or if you prefer to leave them off.

It seems to me that there are a few arguments pro and con:

Pro:
- specifying dimensions makes it so the page doesn't shift around and adjust as it loads the images

Con:
- adds extra text to the code
- means you have to adjust these attributes every time you resize the image

I'd appreciate anyones thoughts on this...

-Damon

RammsteinNicCage

11:13 pm on Mar 20, 2004 (gmt 0)

10+ Year Member



I do mostly because of your pro reason. Also, I have photo galleries on my sites with thumbnails, so adding one thing that says all of these thumbnails should have this size is worth it.

Jennifer

tedster

11:35 pm on Mar 20, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



When I have a small, often repeated graphic - like the icons on this very page - I will omit the dimensions for the file size savings. The graphic will download very fast and not cause the rendering engine much trouble. But I use dimensions in every other case.

R1chard

4:06 pm on Mar 26, 2004 (gmt 0)

10+ Year Member



I do for pretty much all images. Your reason of "you have to adjust these attributes every time you resize the image" isn't much of an issue usually. I don't think I've ever changed the size of more than one or two images in the last 6 or 7 years.

Actually, on a related note, is there a way (preferably in CSS) to add stuff like a fixed height or alt text to an image(s)? I'm thinking of something like

<img src="toolbara.png" class="class_that_puts_in_all_the_constant_stuff">

I've read all about the auto content generation, but never anything like this...

dtribble

2:10 am on Mar 30, 2004 (gmt 0)

10+ Year Member



Thanks for the responses guys... You give me some good things to think on...

-Damon