blogsmith Posted May 13, 2008 Share Posted May 13, 2008 I normally have alt="some text" and title="some text"Is this good or bad practive?Thanks Link to comment Share on other sites More sharing options...
crowheart Posted May 13, 2008 Share Posted May 13, 2008 I normally have alt="some text" and title="some text"Is this good or bad practive?ThanksI use alt for the img and title for the links.. Who knows I am a noob with problems galore right now. Link to comment Share on other sites More sharing options...
crowheart Posted May 13, 2008 Share Posted May 13, 2008 For firefox using the alt and the title attribute works great for displaying the tooltips. IE7 you just need the alt to display the tooltip. What is proper form though is another question. Link to comment Share on other sites More sharing options...
Ingolme Posted May 13, 2008 Share Posted May 13, 2008 alt is not intended for tooltip at all. That's a mistake with Internet Explorer.Alt: An attribute used to display some text in the place of the image if the image was not loaded.Title: An attribute used to show some text in the tooltip above any element when you pass the mouse over it.Never use alt with the intention of showing tooltip text.Here's the correct usage of alt and title:<img src="house.jpg" alt="[image of a small white house]" title="This is my house!"> Link to comment Share on other sites More sharing options...
jeffman Posted May 13, 2008 Share Posted May 13, 2008 And just to safe, realize you can use title with any element, not just links. I use it whenever I have an onclick handler. Link to comment Share on other sites More sharing options...
jesh Posted May 13, 2008 Share Posted May 13, 2008 I use [title] whenever I have an onclick handler.How's that?<div title="Click Me!" onclick="alert('You clicked me!');">Hey</div> Link to comment Share on other sites More sharing options...
Synook Posted May 14, 2008 Share Posted May 14, 2008 Yes, that will work. Link to comment Share on other sites More sharing options...
jesh Posted May 14, 2008 Share Posted May 14, 2008 Yes, that will work.I'm aware of that. My question was more in line with why would you use that on every element that has an onclick handler. Link to comment Share on other sites More sharing options...
Johnmitchell Posted May 15, 2008 Share Posted May 15, 2008 'alt' abreviation for alternate, as in alternet text. title is pretty self explanatory.although in firefox i'm sure alt brings up a tooltip :S might be wrong. Link to comment Share on other sites More sharing options...
Ingolme Posted May 15, 2008 Share Posted May 15, 2008 'alt' abreviation for alternate, as in alternet text. title is pretty self explanatory.although in firefox i'm sure alt brings up a tooltip :S might be wrong. Only Internet Explorer does it. I use Firefox and Opera all the time and neither of them do that. Link to comment Share on other sites More sharing options...
jeffman Posted May 15, 2008 Share Posted May 15, 2008 why would you use [a title] on every element that has an onclick handler.Well, maybe not every one. Remember I'm mostly into web apps, so if a button label or icon might be misunderstood (murphy's law) I'll use a title. But if I've got a spreadsheet sort of thing, then, no, I don't have a title for each cell. "Enter data here. Enter data here . . ." That would be frustrating.When I'm feeling really clever, if one part of the app turns another part off, then I'll null the corresponding title. (Yeah, my scripts can be long.) Basically, I try to use best practice for any good gui. I actually imitate Firefox a lot, since it's always right here.I've never actually written a kill_all_titles function, but I've considered it. Problem is, I'd want a restore_all_titles function, and I've never taken the time to work out that part. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.