Welcome to WebmasterWorld Guest from 54.159.50.111

Forum Moderators: not2easy

Message Too Old, No Replies

No width, height or border on images

     
8:17 pm on Oct 31, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 4, 2002
posts: 1785
votes: 2


I was checking out competitor's sites and noticed that several of them link to images without width, height or border. Just the image link and an alt tag. Not even a css reference.

Has there been a new development in how you can display images? The last time I left off the Width/height/border the image came out with borders on IE and doesn't display at all in other browsers.
9:25 pm on Oct 31, 2010 (gmt 0)

Full Member

joined:July 31, 2005
posts:272
votes: 0


No change. They just are lousy coders or very lazy. ALWAYS tell browsers what you want it to do by coding everything needed for the presentation of your page(s).

I use this sometimes unless I put it in the CSS:


<img style="width: XXpx; height: YYpx; border: 0;" src="Path to image" alt="Text Description">
10:32 pm on Oct 31, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 4, 2002
posts: 1785
votes: 2


Thanks Major, I do the same.

I thought maybe I've had my head stuck in SEO threads too long and missed something important.
3:49 pm on Nov 1, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 28, 2004
posts:7999
votes: 0


They just are lousy coders or very lazy.


Not necessarily, many CMS's and shopping carts make it almost impossible to add width and height attributes without hacking the code. And if you do, the next security upgrade will overwrite it.
4:29 pm on Nov 4, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 4, 2004
posts:877
votes: 0


And if you do, the next security upgrade will overwrite it.


I have a heavily modified phpBB forum, I manually apply changes using Winmerge.
5:22 pm on Feb 7, 2011 (gmt 0)

New User

5+ Year Member

joined:Feb 2, 2011
posts:8
votes: 0


Where do you guys specify your image sizes? In css or html? I thought it was preferred to do this in css, so that's what I've done for my presentation related images. But for content related images, I have some groups where they are all different sizes. I didn't want to bog down my css file with dimensions for each and every image, so I left them out for many. With content related images, is it best to put the dimensions in the html markup?
5:32 pm on Feb 7, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 28, 2004
posts:7999
votes: 0


The idea is that the inline w/h attributes will provide placeholders for the browser to render the layout *before* the images fully load. That way you don't get the bouncy loading layout, elements floating around until it fully loads. So while it's recommended to use w/h inline, a lot of sites don't.
5:43 pm on Feb 7, 2011 (gmt 0)

New User

5+ Year Member

joined:Feb 2, 2011
posts:8
votes: 0


Okay, so I'll fix those content images - put the w/h inline for them. But I'm wondering now about all the layout related images I've set w/h for in css. Should I expect the same bouncing around with them? I'm pretty sure the css gets loaded first.