homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

Can't get code to validate

 3:43 am on Feb 26, 2011 (gmt 0)

Never have done rollover images, everything i find shows it using a "name" attribute, even some javascipt i found, and that the only thing I can not get to validate and its driving me crazy. Can someone please help, or point me towards a better way to do the rollover?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns="http://www.w3.org/1999/xhtml">

only issue is with each rollover link, the "name" wont validate and only shows 1 error, but Say i remove the first attribute "name", it will than show the second one as an error. and removing "name" renders it useless because it wont roll over

<div id="nav">
<a href="index.html"><img src="images/navlinks/homeact.gif" alt="home link" /></a>
<a href="pages/wedding/wedding.html" onmouseover="document.wed.src='images/navlinks/weddingact.gif'"
<img src="images/navlinks/wedding.gif" alt="wedding link" name="wed"/></a>
<a href="pages/engagement/engagement.html" onmouseover="document.eng.src='images/navlinks/engagementact.gif'"
<img src="images/navlinks/engagement.gif" alt="engagement link" name="eng"/></a>
<a href="pages/seniors/seniors.html" onmouseover="document.sen.src='images/navlinks/seniorsact.gif'"
<img src="images/navlinks/seniors.gif" alt="seniors link" name="sen"/></a>
<a href="pages/families/families.html" onmouseover="document.fam.src='images/navlinks/familiesact.gif'"
<img src="images/navlinks/families.gif" alt="families link"name="fam"/></a>
<a href="pages/children/children.html" onmouseover="document.chi.src='images/navlinks/childrenact.gif'"
<img src="images/navlinks/children.gif" alt="children link" name="chi"/></a>
<a href="pages/event/event.html" onmouseover="document.eve.src='images/navlinks/eventact.gif'"
<img src="images/navlinks/event.gif" alt="event link" name="eve"/></a>
<a href="pages/about/about.html" onmouseover="document.about.src='images/navlinks/aboutact.gif'"
<img src="images/navlinks/about.gif" alt="about link" name="about"/></a>
<a href="pages/contact/contact.html" onmouseover="document.con.src='images/navlinks/contactact.gif'"
<img src="images/navlinks/contact.gif" alt="contact link" name="con"/></a>



 9:55 am on Feb 26, 2011 (gmt 0)

Hi there huntt3,

and a warm welcome to these forums. ;)

The use of javascript for link rollovers is twentieth century methodology and should not be used.

Check out these links for CSS methods...
  1. [wellstyled.com ]
  2. [webvamp.co.uk ]
  3. [alistapart.com ]
  4. [css-tricks.com ]



 11:01 am on Feb 26, 2011 (gmt 0)

Do you really need the XHTML DOCTYPE?

Would HTML 4.01 make your life simpler?


 10:26 pm on Feb 27, 2011 (gmt 0)

Older browsers need the name attribute but newer ones need ID. To satisfy everyone, use both name and ID and make them match and unique per page. It should then work with JavaScript or CSS and Doctype of HTML or XHTML.


 2:06 am on Feb 28, 2011 (gmt 0)

Older browsers need the name attribute but newer ones need ID.

There are basically none of these "older browsers" around any more - there is no need at all to use the
name attribute any more.

 2:24 am on Feb 28, 2011 (gmt 0)

Encyclo, I used to believe that such old browsers were gone, too. A coworker at the University of Michigan was teaching a computer class and found that nearly 1/3 of her class couldn't even see her pages. She was using the newest stuff and they were using WebTV!


 2:32 am on Feb 28, 2011 (gmt 0)

Anyone using WebTV these days will find that vast swathes of the web are unusable. There are always a few edge cases, but I've not seen WebTV or any old browsers in any stats for many years. You have to draw the line somewhere, and for me WebTV is way over the other side of that line. :)


 2:45 am on Feb 28, 2011 (gmt 0)

Could she draw the line at losing 1/3 of paying students? It was a language class not web-related except in the sense that it was on-line. To keep her job teaching the class, she had to make her pages available to all her students. The "line" she had to draw was whether or not she wished to get paid.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved