Little bit of HTML advice anyone?

Chris M.

Flashlight Enthusiast
Joined
Jan 17, 2001
Messages
2,564
Location
South Wales, UK
Being a recent convert to them, I have always been frustrated by the fact that Mozilla`s Firebird/Firefox browsers do not display the "alt" text of images in that little tool-tip box when the mouse pointer is hovered over them, which does work in MSIE. Particuarly so, because I use the "alt" text on the TRS to give my exact rating-out-of-50 for each review when you hover your mouse over the little rating pips next to each light in the review listing pages. The pips are actually there as an at-a-glance look, not a "star rating" as one or two people have asked me about. At the moment the actual rating is only given in those "alt" tool-tips, though maybe I should change that....?

Anyways, ever learning new HTML by peeking at other source codes, I recently discovered if I add the attribute title="text goes here" as well as alt="text goes here" in the image tags, I do indeed get the little tool tips in Firefox as well as MSIE. Not wanting to clutter up my code any more than I need to, or have more tags to edit for each new review that I may miss out if I`m not paying attention, I tried just changing all the "alt"s in one review page to "title"s which I tested and found to still work in Mozilla and MSIE.

Now my question is simply: is it OK as far as HTML standards go to use the "title" attribute in place of "alt", or will it cause problems anywhere if I don`t have them both? Previously I have always just seen "alt" used whever it is desirable to have a little tool-tip to explain an image or help you with page navigation, but this actually looks like a non standard MSIE-only quirk given the standards-based Mozilla`s behavior.

Excuse the confused waffle, hopefully someone knows what I mean here and might be able to give a definate answer before I go through the whole TRS and change all the tags over.

wink.gif
 

Negeltu

Enlightened
Joined
Aug 28, 2003
Messages
724
Location
Oregon, USA
Well... title and alt are two different attribs. If you wish to adhere to the html 4.0 standards.. and the xhtml standard for that matter.. you must include the alt attribute for all images. It's an accessibility matter. People with poor vision or none at all...have either voice enabled browsing or braille.... and these return the value of your alt attribute since the blind cannot see your image. The alt should be descriptive of your image. The alt attribute isn't really meant to pop up as a tool tip... /ubbthreads/images/graemlins/smile.gif
 

Chris M.

Flashlight Enthusiast
Joined
Jan 17, 2001
Messages
2,564
Location
South Wales, UK
Thanks for the info. I`ll add the "title" attribute alongside the "alt" to enable those tool tips. I think I really should have the review ratigng displayed on each page as well, don`t know why I never did. No problem, just means I`ll have to remember to update both attributes when assigning ratings to new review pages. Just about all of my pictures and buttons have alt text, the only things that don`t are page structure images like the rounded corners. But they aren`t telling anyone anything so I figure it doesn`t matter.

/ubbthreads/images/graemlins/grin.gif
 

Eugene

Flashlight Enthusiast
Joined
Jun 29, 2003
Messages
1,190
IIRC title is the correct standard way for the little mouse over text, alt was added to the html standard for accessablilty devices for the blind for example. Microsoft choose to use alt for the mouseover so it became common use and gets mistakenly used as standard.
 

Sub_Umbra

Flashlight Enthusiast
Joined
Mar 6, 2004
Messages
4,748
Location
la bonne vie en Amérique
[ QUOTE ]
Eugene said:
...Microsoft choose to use alt for the mouseover so it became common use and gets mistakenly used as standard.

[/ QUOTE ]

Emphasis mine.

Just one small example in the huge list of standards that Microsoft has trashed.
 

Chris M.

Flashlight Enthusiast
Joined
Jan 17, 2001
Messages
2,564
Location
South Wales, UK
I suspected as much. Indeed, having used MSIE since the beginning, it was amazing to see how many things MSIE would let you get away with that it shouldn`t, when I finally tried a standards-based browser. It was an eye-opener to test some of my early MSIE-tested pages with Netscape 4.7 and see what a mess they were. Admittedly NS4.7 is fairly grim and won`t forgive the slightest mistake or short-cut, but that did make it a good "extreme" test for my hand made code. I had begun to suspect the "alt tool tips" were a nonstandard behavior of MSIE in recent times since switching my allegiances over to the Big Lizard. Firefox does have its problems here but that`s probably because of an archaic display card with no driver updates released since about 1997. It`s fine at work on a more modern P3 box.

Nowadays I try to make the TRS and all my other pages as standards-compliant as I can get without actually taking a formal course in HTML4.0. If anyone spots anything that shouldn`t be the way it is, please tell me!

The only thing about MSIE I miss is the CSS scrollbar-color attribute. Probably not a part of the standards for now since Moz and NS don`t support it, but I hope it will be eventually. Helps to blend a web page in to its surroundings like the little "Favicons".


icon.gif
 

The_LED_Museum

*Retired*
Joined
Aug 12, 2000
Messages
19,414
Location
Federal Way WA. USA
I've used 'alt="text"' since I put together my first web page in early 1999.
Changing all of the "alt" tags to "title" now would be a real pain in the toliet muscle, and I won't do it. /ubbthreads/images/graemlins/jpshakehead.gif
 

Negeltu

Enlightened
Joined
Aug 28, 2003
Messages
724
Location
Oregon, USA
Not really necessary.

I seriously doubt with the way things are going...that your pages are gonna break in any of the important browsers. They are all slow on taking up the standards anyway. Half of you probably don't even use the doctype at the top of your source pages. If you don't add that then the browser doesn't even know what it should be validating for.
 
Top