Jump to content

cross browser question


speedy33417

Recommended Posts

I mainly use IE, but I'd like my script to do the same thing on Safari and Firefox, too.

 

<img border="0" src="images/img.jpg" width="60" height="54" alt="Something" />

 

In IE when I hover over the image I get a the "Something" text show up, but not in Safari or Firefox. How do I write this code tho work on all 3 browsers?

Link to comment
Share on other sites

To answer your question, add

 

title="something"

 

to your tag.

 

For a piece of advice, its a good idea to design your sites in either firefox or safari, and then after they work tweak them for Internet Explorer. IE is not a very good browser in that it works on its own set of rules rather than the established rules of the web. That means it does things differently than other browsers, which do things the proper way. So if you are coding your site for IE, it's quite difficult to adjust your code for other browsers and get it to work the same across browsers. It's much easier to start in one of the other browsers, then make it work for IE after that. There are special IE tweaks (called conditional comments) specifically for that.

 

Good luck!

Link to comment
Share on other sites

^ in a nutshell... alt="" wasn't original designed to be displayed when you hover over an image. alt is for when text can't be displayed, the alt value displays. FF and others do it right by not showing alt things, so, like the above poster said, you need to have it in the title=""

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.