...

View Full Version : Resolved Help OGGordon get his website validated ERROR FREE



OGGordon
11-18-2009, 09:13 PM
Sup guys and gals,

so I am in the process of cleaning up my first website :thumbsup:
Unfortunately, I encountered 160 errors + 1 warning :eek: ugh.

Some of the errors are easy to fix however some I just can't figure out. Hopefully, probably you guys can help me out.

Here's one:


Line 59, Column 55: required attribute "alt" not specified
<br><img src="images/spacer.gif" height="2" width="2"></br>

The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.

Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.

I'm not sure how I can fix that one. Can I just add: alt=""
where the error was found?

TIA btw.

the URL is www.testobject.cwsurf.de

j05hr
11-18-2009, 09:18 PM
Yeah you just need to add an alt tag to your images

<a href="link.html"><img src="pictures/image.jpg" alt="altText" /></a>

It basically just means if the image isn't displayed the alt text will be displayed instead.

MattF
11-18-2009, 09:20 PM
The alt text should give some meaningful description which will be displayed inplace of the image if the image can't be displayed, or the client doesn't display the images, i.e: when using a text mode browser.

OGGordon
11-18-2009, 09:25 PM
I added the alt attribute and I get a parse error on my website

this is how i added it, correct right?


"<br><img src=\"images/spacer.gif\" height=\"2\" width=\"2\" alt="spacer" /><br>";

Apostropartheid
11-18-2009, 09:26 PM
You forgot to escape those quotes.

j05hr
11-18-2009, 09:29 PM
Ah yeah I didn't see you were doing it in PHP


"<br><img src=\"images/spacer.gif\" height=\"2\" width=\"2\" alt=\"spacer\" /><br>";

OGGordon
11-18-2009, 09:33 PM
aah okay nice. A lot of errors are missing the alt tribute. Thanks for the help guys, that should get rid of many errors. I'll check back in later for more questions :D

OGGordon
11-18-2009, 10:41 PM
I get a ton of these errors

Line 180, column 6: end tag for "br" omitted, but OMITTAG NO was specified

But I thought a br tag is empty and doesn't need an end tag?

met
11-18-2009, 11:18 PM
if you are coding to xhtml standards certain tags need to be "closed" even if they don't come in pairs



<br />

<img src="img.jpg" alt="img" />

<hr />

OGGordon
11-19-2009, 01:14 AM
thanks, fixed all the br errors :thumbsup:


17 more errors to go! woo woo :thumbsup:

it's already 1 am here and my eye lids are getting heavier and heavier. Time to drink some coke to continue :D:thumbsup:

OGGordon
11-19-2009, 01:40 AM
All errors are gone! Today's goal: achieved

Thanks everyone for helping me out! I'll be back for CSS validation lol



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum