Forum Moderators: not2easy

Message Too Old, No Replies

To specify image dimensions or not to specify

that's the question

         

thrasher141

9:16 pm on Dec 1, 2005 (gmt 0)

10+ Year Member



I couldn't find anything about this on the internet, so I thought I'd see what you webmasterworld experts think. Is it better to specify image dimensions in the html code (or CSS rather) or not specify?

I just ran into a problem where a sidebar image had been modified but a couple of the pages that used it specified the wrong dimensions (probably for the old image). I thought to myself...if the dimensions simply were never specified this wouldn't have been a problem and it would have saved coding time. So I lean toward not specifying dimensions in the HTML/CSS and keeping it simple.

Any other thoughts?

Kevin French

9:25 pm on Dec 1, 2005 (gmt 0)

10+ Year Member



I always specifcy....it makes page loading much more user-friendly. This way...content doens't move around while the page loads.

Leosghost

9:27 pm on Dec 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Better not to specify IMO
Not specifying can also stop your nav set if you use frames ( why you would want to do so is beyond me ..but ) sliding under your main page and delivering a site with no visible nav system ..

Fixed one of these this summer designed by some "extra clever" soul ..only IE could see his nav contents ..it didn't obey his code error size spec ..everthing else did and hid the nav entirely ..

Client was not amused as he could see his site nav .and use it ..his partners couldnt :).."extra clever" was already paid and gone on holiday ..and couldn't be contacted by non tech client ..

topsites

7:04 am on Dec 6, 2005 (gmt 0)



I see it this way:
A browser is a software-driven engine which reads, interprets, and displays code onto a screen. When faced with an image, adding the width, height, border AND alt attributes feed the browser crucial information pertaining to the display of said image. Lacking this information means the browser spends extra time formatting and figuring things out which, had it been given the information by the author, it would've known.

The w3 sees it thusly:
The height and width attributes give user agents an idea of the size of an image or object so that they may reserve space for it and continue rendering the document while waiting for the image data.

(user agent = browser)

We may not phrase things the same, but I would say the w3 and I agree when I say that adding the required image tag attributes helps speed up load-times.

Now one might wonder about the alt-attribute...
To keep things short, this tag has to do with accessibility for people with disabilities.

Hope is help.

tbear

11:47 am on Dec 6, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I always add the size attributes to images, both for layout stability while loading and for the sake of my visitors nerves....;)

I go apes**t every time I use my Hotmail account! Damned buttons are shifting about all over the place while image stuff (with no sizes) I never see/use is loading and I just wanna click a button.

No image sizes is definitely user unfriendly!

I'll also second the point of giving the browser as much info as it needs, to cut down on loading times, albeit apparent.

thrasher141

6:07 pm on Dec 6, 2005 (gmt 0)

10+ Year Member



I definitely see what y'all are saying about specifying image dimensions to give the browser more info and to help speed up loading times. I know I've heard the loading time argument before a while ago when more people were on modems...but does that argument still hold weight today? I know that there are still some people on modems, but I think most are on high speed now. When I surf from my corporate LAN, I almost never have to wait for a page to load - they are usually instantaneous.

Also, being a lazy web developer who likes taking shortcuts, I don't want to specify image dimensions, and I certainly don't want to go back in the code and change them if I modify an image. Should I be fired?

islandlizard

2:51 am on Dec 7, 2005 (gmt 0)

10+ Year Member



I definitely see what y'all are saying about specifying image dimensions to give the browser more info and to help speed up loading times.
I know I've heard the loading time argument before a while ago when more people were on modems...but does that argument still hold weight today?
I know that there are still some people on modems, but I think most are on high speed now. When I surf from my corporate LAN, I almost never have to wait for a page to load - they are usually instantaneous.

Also, being a lazy web developer who likes taking shortcuts, I don't want to specify image dimensions, and I certainly don't want to go back in the code and change them if I modify an image. Should I be fired?

What a scary attitude!

"I build stuff, I get paid for it, but don't give a crap if it works for those who paid me, or those who will use it. As long as it works for me, and my computer, with my connection, its good enough"

If someone actually hired you specifically to build web sites, I would suggest *they* are fired!

Lorel

2:11 am on Dec 12, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



It also won't validate unless you add height/width and alt tags and most search engine quidelines say validate the code.

Stefan

2:40 am on Dec 12, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Specify it. For those of us on dial-up, it's disturbing to have text suddenly shift around on the page while it's loading. I always use size attributes because of that.

topsites

8:51 am on Dec 12, 2005 (gmt 0)



To me load-times are important because it helps make a faster, more efficient world wide web. The faster we serve them, the sooner the server's work is done. The less work the server has to do, the less cpu one needs - this translates into savings... I still run on the same 900mhz server I started leasing 3 years ago :-)

It is only due to streamlining and making things more efficient that I have been able to save 20, then 40, and lately 60-80 dollars/month as I have NOT had to upgrade to a more powerful server (such as a 2.4ghz, for example). And if I do upgrade, wow...

Although with broadband most sites load fast, I like mine to pop on to the screen like BLAM! without delay, the entire page is displayed in a literal instant, it is so sexy when it does that :-)
No offense to the big guys, but:
Yahoo is slow nowadays.
Google is BLAM!
Load the two, see what I mean? delays... or not...

bs aside...
For an online business, this helps maximize profit.
For a hobbyist, it keeps the expense down.
Either way, it's win-win:
The admins save money, the visitors get served faster.

Because jokes aside, the Internet really isn't free.