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
https://forums.phpfreaks.com/topic/111265-cross-browser-question/
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!

^ 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=""

Archived

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

×
×
  • 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.