Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 11 of 11
  1. #1
    Regular Coder
    Join Date
    Oct 2009
    Location
    GERMANY
    Posts
    140
    Thanks
    29
    Thanked 1 Time in 1 Post

    Help OGGordon get his website validated ERROR FREE

    Sup guys and gals,

    so I am in the process of cleaning up my first website
    Unfortunately, I encountered 160 errors + 1 warning 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:

    Code:
     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
    Last edited by OGGordon; 11-19-2009 at 02:07 PM. Reason: thanks for everyone's help!

  • #2
    Regular Coder
    Join Date
    Nov 2008
    Posts
    175
    Thanks
    4
    Thanked 6 Times in 6 Posts
    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.

  • Users who have thanked j05hr for this post:

    OGGordon (11-18-2009)

  • #3
    Senior Coder
    Join Date
    Jul 2009
    Location
    South Yorkshire, England
    Posts
    2,318
    Thanks
    6
    Thanked 304 Times in 303 Posts
    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.

  • Users who have thanked MattF for this post:

    OGGordon (11-18-2009)

  • #4
    Regular Coder
    Join Date
    Oct 2009
    Location
    GERMANY
    Posts
    140
    Thanks
    29
    Thanked 1 Time in 1 Post
    I added the alt attribute and I get a parse error on my website

    this is how i added it, correct right?

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

  • #5
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    You forgot to escape those quotes.

  • Users who have thanked Apostropartheid for this post:

    OGGordon (11-18-2009)

  • #6
    Regular Coder
    Join Date
    Nov 2008
    Posts
    175
    Thanks
    4
    Thanked 6 Times in 6 Posts
    Ah yeah I didn't see you were doing it in PHP

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

  • Users who have thanked j05hr for this post:

    OGGordon (11-18-2009)

  • #7
    Regular Coder
    Join Date
    Oct 2009
    Location
    GERMANY
    Posts
    140
    Thanks
    29
    Thanked 1 Time in 1 Post
    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

  • #8
    Regular Coder
    Join Date
    Oct 2009
    Location
    GERMANY
    Posts
    140
    Thanks
    29
    Thanked 1 Time in 1 Post
    I get a ton of these errors
    Code:
    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?

  • #9
    met
    met is offline
    Regular Coder
    Join Date
    Oct 2009
    Location
    United Kingdom
    Posts
    728
    Thanks
    4
    Thanked 119 Times in 119 Posts
    if you are coding to xhtml standards certain tags need to be "closed" even if they don't come in pairs

    PHP Code:
    <br />

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

    <
    hr /> 

  • Users who have thanked met for this post:

    OGGordon (11-19-2009)

  • #10
    Regular Coder
    Join Date
    Oct 2009
    Location
    GERMANY
    Posts
    140
    Thanks
    29
    Thanked 1 Time in 1 Post
    thanks, fixed all the br errors


    17 more errors to go! woo woo

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

  • #11
    Regular Coder
    Join Date
    Oct 2009
    Location
    GERMANY
    Posts
    140
    Thanks
    29
    Thanked 1 Time in 1 Post
    All errors are gone! Today's goal: achieved

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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •