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

HTML Forum

    
Can't get code to validate
huntt3



 
Msg#: 4272780 posted 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?

using:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<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'"
onmouseout="document.wed.src='images/navlinks/wedding.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'"
onmouseout="document.eng.src='images/navlinks/engagement.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'"
onmouseout="document.sen.src='images/navlinks/seniors.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'"
onmouseout="document.fam.src='images/navlinks/families.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'"
onmouseout="document.chi.src='images/navlinks/children.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'"
onmouseout="document.eve.src='images/navlinks/event.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'"
onmouseout="document.about.src='images/navlinks/about.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'"
onmouseout="document.con.src='images/navlinks/contact.gif'">
<img src="images/navlinks/contact.gif" alt="contact link" name="con"/></a>
</div>

 

birdbrain

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 4272780 posted 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 ]

birdbrain

g1smd

WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4272780 posted 11:01 am on Feb 26, 2011 (gmt 0)

Do you really need the XHTML DOCTYPE?

Would HTML 4.01 make your life simpler?

jalarie

10+ Year Member



 
Msg#: 4272780 posted 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.

encyclo

WebmasterWorld Senior Member encyclo us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4272780 posted 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.
jalarie

10+ Year Member



 
Msg#: 4272780 posted 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!

encyclo

WebmasterWorld Senior Member encyclo us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4272780 posted 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. :)

jalarie

10+ Year Member



 
Msg#: 4272780 posted 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