Jump to content


Photo

<img name=....> not XHTML?


  • Please log in to reply
3 replies to this topic

#1 extrovertive

extrovertive
  • Members
  • PipPipPip
  • Advanced Member
  • 235 posts

Posted 06 August 2006 - 06:32 AM

I have rollover images on my site. It uses <img name="thename" ....> for the javascript to work. Now, when I tried to validate my site with XHTML strict, I get a warning that the "name" in invalid/deprecated. Now, what do I use do then?

#2 extrovertive

extrovertive
  • Members
  • PipPipPip
  • Advanced Member
  • 235 posts

Posted 06 August 2006 - 10:07 AM

ah nevermind.  I use "id"

#3 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 07 August 2006 - 02:35 PM

<img src="image1.gif" onmouseover="image2.gif" onmouseout="image1.gif" />

Would do it without IDs or names.

#4 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 07 August 2006 - 03:00 PM

using id is perfectly legitimate in XHTML. this is actually the easiest way to reference an img tag, however, like daniel0 shows in his example, you've got to make your images self-closing tags. the other problem that you might be facing (that daniel0 doesn't show) is that for valid XHTML, you also must have an alt attribute, even if it is empty.
You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users