PDA

View Full Version : Width and Height attributes of your image


mattwheeler
04-20-2004, 01:09 PM
Hi,

I use a search engine optimization program and one of the warnings I recieve that apparently effects my ranks are width and height attributes of images. Because the statcounter code is on every page of my site, every page is flagged. Is there any way of adding some width and height attributes to the code of your image?

Thanks
Matt

gtiporter
04-22-2006, 11:08 PM
I have the same problem when validating my website in webxact for accessibility. It states "Elements missing height and width attributes:" and refers to the statcounter code. My code for statcounter is invisible and is xhtml compliant

any ideas-do i need to set a height and width attribute and if so how

webado
04-22-2006, 11:53 PM
If you generate the xhtml and w3c compliant code you have a class or id for styling. Then you go and add the proper class or id declaration in your own style sheet.

The only thing the validators require is an alt attribute, and that is there.

I'd venture that webexact is not quite accurate in its diagnosis. Images can have their sizing specified in css, not necessarily in an img tag.

If you want to put it, then add width="1" height="1" to the img tag for an invisible ciounter, or whatever the image is for the visible one (right click it when you see it and get its dimensions).

gtiporter
04-23-2006, 09:48 AM
thanks for the answer-setting the width and height works beautifully. I tried it the other day and could not get it to work. Did it this morning and no problems-benefit of sleep i think

thank u :-D