Jump to content

Archived

This topic is now archived and is closed to further replies.

extrovertive

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

Recommended Posts

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?

Share this post


Link to post
Share on other sites
[code]<img src="image1.gif" onmouseover="image2.gif" onmouseout="image1.gif" />[/code]

Would do it without IDs or names.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.