XHTML Validation Error

They have: 7 posts

Joined: Sep 2007

Hi, i am just about to convert my 50 page website into XHTML.

but i came across a problem straight away...

can you see any reason why this would not validate?

the XHTML validator says: # Error Line 111 column 169: there is no attribute "alt".

HTML

  • » Karen & John Wilson
  • Thanks in advance

    greg's picture

    He has: 1,581 posts

    Joined: Nov 2005

    you have an "alt" in a href anchor
    just remove it

    an alt tag is used for an image (img) and there are plenty of reasons the image might not display and you want 'alt text'
    I don't actually know what/where/how an alt tag on a link would be any use. if the link doesnt work for whatever reason then the alt text wont work either

    when you are validating with the W3C website, usually what it tells you is the exact error, but sometimes it's not actually the error or even the line it deems the error to be on
    for example not ending some tags correctly ( etc) it may tell you the line it finds the error, but that will actually be the START for the next tag, and you are actually looking for inputting the END of the last tag as you missed it
    As I said, usually it accurate, but if when you look where it's telling you the error is not there you will have to find it
    it is usually relelvant in some way to what it is reporting

    They have: 222 posts

    Joined: Sep 1999

    You might want to try title="" instead of alt if you want a tooltip over the link

    They have: 29 posts

    Joined: Oct 2007

    Talks_44;224319 wrote: Hi, i am just about to convert my 50 page website into XHTML.

    but i came across a problem straight away...

    can you see any reason why this would not validate?

    the XHTML validator says: # Error Line 111 column 169: there is no attribute "alt".

    HTML

  • » Karen & John Wilson
  • Thanks in advance

    alt is used in images, not in a href

    Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.