Jump to content

XHTML Validation Error

there is no attribute "alt".

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

XHTML Validation Error there is no attribute "alt". Rate Topic: ****- 1 Votes

#1 User is offline   Man2u2uk 

  • W.R. Lieutenant
  • Group: Members
  • Posts: 396
  • Joined: 14-April 07
  • Gender:Male

Posted 09 May 2007 - 05:14 PM

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".

<li><a href="images/photo_gallery/large_view/karen-with-john-wilson.jpg" rel="lightbox"
title="Romsey Game Fair - 30/07/06 - Karen With John Wilson"
alt="Romsey Game Fair - 30/07/06 - Karen With John Wilson">» Karen & John Wilson</a></li>


Thanks in advance
0

#2 User is offline   sypher 

  • the owner3r
  • Group: Administrators
  • Posts: 1,578
  • Joined: 04-April 06
  • Location:North Wales, UK
  • Interests:Art, Boxing, MMA, Graphic Design, Web Design etc. ;)

Posted 09 May 2007 - 06:17 PM

A link uses title="" as the acessibility option. Not alt=""
sypher design - North Wales Web Design | Latest Work: - Scala Cinema

CSS - Can't See Sh*t
0

#3 User is offline   marcamos 

  • W.R. General
  • Group: Administrators
  • Posts: 2,849
  • Joined: 04-April 06
  • Gender:Male
  • Location:Massachusetts - USA

Posted 09 May 2007 - 10:42 PM

Additionally, the alt attribute stands for 'alternate', and always contains a description of an element that a person might not be able to see. Commonly used in images, the alt attribute is meant to supply alternate information for those who cannot see the images.

In your case, the linked text is pure text, and therefore doesn't (supposedly) need alternate information. As Sypher suggested, the title attribute is all that you need to explain the link in more detail.
0

#4 User is offline   Man2u2uk 

  • W.R. Lieutenant
  • Group: Members
  • Posts: 396
  • Joined: 14-April 07
  • Gender:Male

Posted 10 May 2007 - 04:23 AM

Ah ok.

thought my website wherever i have put a link i have always included an alt and title tag. as i thought

Alt = Internet Explorer

Title = Firefox

Thanks
0

#5 User is offline   James Mitchell 

  • Legendary
  • Group: Administrators
  • Posts: 922
  • Joined: 26-July 06
  • Gender:Male
  • Location:Fort Wayne, IN

Posted 10 May 2007 - 08:01 AM

Yeah that I am sure is a common misunderstanding. The rule is:

Title tags go with links:
<a href="http://path.to/url.html" title="descriptive title for link">Link Text</a>

Alt(ernate) tags go with images:
<img src="http://path.to/image.jpg" height="100" width="100" alt="descriptive text for image" />

The next question one is likely to ask is which tags are required? Great, glad you asked. The with links no title tag is required. It is additional information that can aid the user to know if its a link they want to follow. With images it is a good idea to include the height and width tags and it IS required to have an alternate tag (even if it is just alt=""). The reason the tag is required, is for those instances when browsers don't render the image or if a user has disabled images on their end, the alternate tag will appear in its place. Thus providing the user a description of what was supposed to be there.

Hopefully that helps and isn't too confusing.
Posted Image
0

#6 User is offline   Man2u2uk 

  • W.R. Lieutenant
  • Group: Members
  • Posts: 396
  • Joined: 14-April 07
  • Gender:Male

Posted 10 May 2007 - 08:06 AM

Thanks JP.

Well all of my images have alts & title tags which explain the picture... so i think i will leave them all there.

the reason i put them there is because alt="" does not show in firefox. i had to use title=""

but so far i have successfully validated 4 out of 52 pages into XHTML :)

hopefully i will be done by tonight....


P.s : do i need to validate my style sheets as well? i have about 7...
0

#7 User is offline   marcamos 

  • W.R. General
  • Group: Administrators
  • Posts: 2,849
  • Joined: 04-April 06
  • Gender:Male
  • Location:Massachusetts - USA

Posted 10 May 2007 - 09:12 AM

View PostMan2u2uk, on May 10 2007, 09:06 AM, said:

the reason i put them there is because alt="" does not show in firefox. i had to use title=""

Actually, you have that backwards. Firefox is doing the correct thing by not showing the alternate text when you hover over an element. Internet Exploder is doing the wrong thing by showing it on hover. All browsers will show title information on hover, but none of them are supposed to show the alt information on hover. This is yet another example of IE doing the wrong thing, but convincing people it is the correct thing, because it's been around so damned long.

View PostMan2u2uk, on May 10 2007, 09:06 AM, said:

P.s : do i need to validate my style sheets as well? i have about 7...

It can't hurt :ninja: http://jigsaw.w3.org/css-validator/
0

#8 User is offline   James Mitchell 

  • Legendary
  • Group: Administrators
  • Posts: 922
  • Joined: 26-July 06
  • Gender:Male
  • Location:Fort Wayne, IN

Posted 10 May 2007 - 10:09 AM

View Postherkalees, on May 10 2007, 10:12 AM, said:

Actually, you have that backwards. Firefox is doing the correct thing by not showing the alternate text when you hover over an element. Internet Exploder is doing the wrong thing by showing it on hover. All browsers will show title information on hover, but none of them are supposed to show the alt information on hover. This is yet another example of IE doing the wrong thing, but convincing people it is the correct thing, because it's been around so damned long.
It can't hurt :ninja: http://jigsaw.w3.org/css-validator/

Amen!
Posted Image
0

#9 User is offline   Man2u2uk 

  • W.R. Lieutenant
  • Group: Members
  • Posts: 396
  • Joined: 14-April 07
  • Gender:Male

Posted 10 May 2007 - 10:14 AM

Ok

so at the moment i have just title tags for some of my text links

and title & alt tags for my pictures.

and as they have validated XHTML with no problems, i guess this is ok?

P.S only 20 pages to go till my site is completly XHTML :)
0

#10 User is offline   marcamos 

  • W.R. General
  • Group: Administrators
  • Posts: 2,849
  • Joined: 04-April 06
  • Gender:Male
  • Location:Massachusetts - USA

Posted 10 May 2007 - 10:25 AM

View PostMan2u2uk, on May 10 2007, 11:14 AM, said:

and as they have validated XHTML with no problems, i guess this is ok?

It's more than OK, it's correct.
0

#11 User is offline   Man2u2uk 

  • W.R. Lieutenant
  • Group: Members
  • Posts: 396
  • Joined: 14-April 07
  • Gender:Male

Posted 10 May 2007 - 04:34 PM

Ok i have finally converted all my of website to XHTML 1.0 Strict :)

and my CSS is 99% validated bar one problem..

for my gallery i use the lightbox addon.. and this failing validation.

* html #overlay {
	background-color: #333;
	background-color: transparent;
	background-image: url(../images/blank.gif);
 filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="overlay.png", sizingMethod="scale");
}


24 * html #overlay attempt to find a semi-colon before the property name. add it
24 * html #overlay Property progid doesn't exist : DXImageTransform
24 * html #overlay Parse Error - DXImageTransform.Microsoft.AlphaImageLoader(src="overlay.png", sizingMethod="scale");
25 * html #overlay Parse error - Unrecognized }


hopefully you guys will know of a solution around this...

P.S can someone also check www.ukfishersonline.com to see if it is validated properly..
0

#12 User is offline   marcamos 

  • W.R. General
  • Group: Administrators
  • Posts: 2,849
  • Joined: 04-April 06
  • Gender:Male
  • Location:Massachusetts - USA

Posted 10 May 2007 - 05:25 PM

View PostMan2u2uk, on May 10 2007, 05:34 PM, said:

Ok i have finally converted all my of website to XHTML 1.0 Strict :)

and my CSS is 99% validated bar one problem..

for my gallery i use the lightbox addon.. and this failing validation.

* html #overlay {
	background-color: #333;
	background-color: transparent;
	background-image: url(../images/blank.gif);
 filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="overlay.png", sizingMethod="scale");
}


24 * html #overlay attempt to find a semi-colon before the property name. add it
24 * html #overlay Property progid doesn't exist : DXImageTransform
24 * html #overlay Parse Error - DXImageTransform.Microsoft.AlphaImageLoader(src="overlay.png", sizingMethod="scale");
25 * html #overlay Parse error - Unrecognized }


hopefully you guys will know of a solution around this...

P.S can someone also check www.ukfishersonline.com to see if it is validated properly..


I'm 100% certain it has to do with that last bit of styles, the elusive Microsoft-based filer property. I'm also unaware of any sort of fix. I'd simply not worry about it, and (again), be proud that you've come so far.

Great work my friend.
0

#13 User is offline   TJSingleton 

  • Allegedly Legendary
  • Group: Members
  • Posts: 517
  • Joined: 31-July 06
  • Location:Winder, GA

Posted 12 May 2007 - 10:08 AM

Could add it to a conditional comment.
0

#14 User is offline   Man2u2uk 

  • W.R. Lieutenant
  • Group: Members
  • Posts: 396
  • Joined: 14-April 07
  • Gender:Male

Posted 12 May 2007 - 12:34 PM

Well i am pretty happy as it stands :)

i now have a XHTML 52 page website

a forum (which has no members lol)

a shop (which is half XHTML)

99% of my CSS is valid :)
0

#15 User is offline   TJSingleton 

  • Allegedly Legendary
  • Group: Members
  • Posts: 517
  • Joined: 31-July 06
  • Location:Winder, GA

Posted 12 May 2007 - 02:21 PM

And a degree in math? :D
0

#16 User is offline   Man2u2uk 

  • W.R. Lieutenant
  • Group: Members
  • Posts: 396
  • Joined: 14-April 07
  • Gender:Male

Posted 12 May 2007 - 02:25 PM

Lol I Wish
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users