Welcome to WebmasterWorld Guest from 54.196.153.46

Forum Moderators: incrediBILL

Message Too Old, No Replies

Ampersand in the alt tag and tool tip

     
11:33 am on Jul 13, 2001 (gmt 0)

Senior Member

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:May 26, 2000
posts:37301
votes: 0


This is a niggling little issue I've never resolved. I have a client who is very particular that their business name alwys be spelled with an ampersand, and never with the word "and" or with a "+" sign.

The issue becomes how to get this to work in the alt attribute for an image, and the resultant tool tip that Netscape and Explorer display when the cursor rests on the image. "& amp;" doesn't work, and the closest I came was coding it as "&&", which worked in Explorer but not Netscape.

Any ideas?

3:28 pm on July 13, 2001 (gmt 0)

Junior Member from US 

10+ Year Member

joined:July 7, 2001
posts:75
votes: 0


OK tedster, hope this helps...

Like you, I also found that using <img src=benjerry.gif alt=Ben && Jerry> will NOT work in NS.

HOWEVER, inserting quotes WILL do the trick!   see below...

<img src=benjerry.gif alt="Ben && Jerry">

I generally use quotes around all my attribute values because my HTML editor (Arachnophilia) enters them automatically and uses them for its tag coloring scheme.

But there's obviously more than just aesthetics going on here.

--Gene

4:22 pm on July 13, 2001 (gmt 0)

Administrator from US 

WebmasterWorld Administrator brett_tabke is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Sept 21, 1999
posts:38063
votes: 13

Add a Title attribute - & a m p ; works in them. Test this with mouseover
Also - you can put a return char in a Title attribute. (can't demonstrate it here). Click on owner edit, to view source.
5:10 pm on July 13, 2001 (gmt 0)

Junior Member from US 

10+ Year Member

joined:July 7, 2001
posts:75
votes: 0


Brett--

I'm afraid the "title" attribute isn't supported by the "img" tag in NS, at least not in NS4.08, which is what tedster needs--or did I misunderstand tedster.

(Tedster-- which tag are you inquiring about: <img> or <a> ?)

Still, I'm glad you mentioned it Brett. I wasn't familiar with the "title" attribute for <a> tags. Very nice indeed!

--Gene

5:21 pm on July 13, 2001 (gmt 0)

Administrator from US 

WebmasterWorld Administrator brett_tabke is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Sept 21, 1999
posts:38063
votes: 13

&& works in NN4 for me.

&&

title - yep, you can apply a title attribute to almost all html4 tags.

5:35 pm on July 13, 2001 (gmt 0)

Senior Member

WebmasterWorld Senior Member rcjordan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Apr 22, 2000
posts:9138
votes: 0


>&& works in NN4

Yep, I'm looking at "&" on the above logo using NN4, title tag is ignored. IE5 shows title, but no alt atributes (&& single ampersand).

5:53 pm on July 13, 2001 (gmt 0)

Senior Member

WebmasterWorld Senior Member mivox is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Dec 6, 2000
posts:3928
votes: 0


NN4.7 Mac shows no title tag pop-ups for either the text link or the image. IE5 Mac shows a little speech bubble pop-up for both... with ampersands.
10:24 pm on July 13, 2001 (gmt 0)

Senior Member

joined:June 27, 2000
posts:1548
votes: 0


Brett,

Can you show the code for that?

<sidenote>
Is it better to use a title tag than it is to use an alt tag for images? Do you use both? And if you do use bothy, which shows up? The alt tag or the title tag?
</sidenote>
-G

12:52 am on July 14, 2001 (gmt 0)

Senior Member

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:May 26, 2000
posts:37301
votes: 0


Thanks, everyone. I never thought about using title tags to handle the tooltip for the non-NN4 browsers. That's a help.

The more I examine this little backwater of page design, the crazier it gets. More complication sets in when images are turned off and the alt text itself is displayed in the image place holder. I can't find a method that gives the right text in both the tooltip AND the image placeholder -- as well as working cross browser. Such is life.

6:24 am on July 14, 2001 (gmt 0)

Administrator from US 

WebmasterWorld Administrator brett_tabke is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Sept 21, 1999
posts:38063
votes: 13


Click on "owner edit" to view the code grnidone.

Title or Alt? Use both. Title is intended for the mouse over, while alt is intended for non-graphical agents. Alt should be an "alternative" to the graphic, while title should be "descriptive" of the graphic.

<a href="/"><img src="logo.gif" alt="link to home page" title="Ben and Jerry's ice cream addict support center"></a>

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members