Web Hosting Talk







View Full Version : Alt Tags


a777uk
06-21-2003, 08:10 PM
I have some text in a table cell and am wanting to add an alt tag to it like on images. Is there anyway to do this with text?

digitok
06-21-2003, 10:19 PM
Hmm... I'm not sure of a direct way... But you can do:

<a title="alt text here">text</a>

I know it uses the <a> tag, even though it's not a link (that WON'T link it, because it has no 'href' attribute). But I guess people use <a name=""> for anchors, so why not use it for alt tags aswell :P

Hope it helps.

modihost
06-22-2003, 12:36 AM
on image tags you can do


<img src="whatever.jpg" alt="alt text">

if you want to put alt text on normal text do this

<span title="alt text">some text here</span>

digitok
06-22-2003, 02:10 AM
Well yeah, span can do the job too. :)

ijg0
06-22-2003, 08:24 AM
Thanks Guys. :)I have used the <span> tags and its works great. I was thinking of putting a transparent giff with an alt tag but then it get messy.

Cheers :)

123x
06-22-2003, 10:14 AM
learn some basic HTML, use FrontPage.. hahhaha..

akashik
06-22-2003, 12:39 PM
alt text on text! Who woulda thunk it... I've never even considered trying that. Might be pretty dern handy.

Rich2k
06-22-2003, 02:09 PM
Originally posted by 123x
learn some basic HTML, use FrontPage.. hahhaha..

You are joking right?

Actually I will give MS some credit. The next version of Frontpage is VERY nice.

Daijoubu
06-22-2003, 04:33 PM
<td title="asdf">weeeee</td> ?
Anyway ALT text are not for tooltips, but screen reader

Rich2k
06-22-2003, 04:52 PM
The W3C describe the title attribute as 'advisory title/amplification' under XHTML

And in HTML 4.0 they do not state that it is only for screen readers and they explicitly mention 'tooltips'

http://www.w3.org/TR/REC-html40/struct/global.html#h-7.4.3

Lagniappe-labgeek
06-23-2003, 01:53 PM
I had never thought of the title= part in the td or span tags. Also works in the th tag, which is where I think I could put it to use. Could be handy for those columns where the data is small (like numbers) but the header requires some explaining and you don't want to waste the table room. Nice... Thanks!

Daijoubu
06-23-2003, 06:37 PM
In Opera and any gecko engine based browser (Mozilla for ex) alt aren't used as tooltips
Only IE shows alt as tooltips

modihost
06-23-2003, 08:23 PM
Originally posted by Daijoubu
In Opera and any gecko engine based browser (Mozilla for ex) alt aren't used as tooltips
Only IE shows alt as tooltips

i think that is a bug in mozilla, cause i remember alt tags working before.. i think or maybe i am :crazy:

Rich2k
06-24-2003, 04:50 AM
It's true that they don't display in those browsers... which personally I think is stupid.... but hey 95% of all browser accesses are IE these days anyway.

Daijoubu
06-26-2003, 05:40 AM
IE is the most boggus browser, bunch of CSS and XML rendering bugs
(I'm still using that alongs with Opera...)

Rich2k
06-26-2003, 07:36 AM
Originally posted by Daijoubu
IE is the most boggus browser, bunch of CSS and XML rendering bugs
(I'm still using that alongs with Opera...)

Still something you have to live with and design for... as 95% of all browser accesses are IE... and it doesn't look likely to change any time soon.

andhosting
06-28-2003, 05:42 PM
But the bugs have become the norm for most web developers, so they see the "correct" way of displaying CSS/XML as the IE way, and the Gecko/Mozilla way as the buggy way...

Rich2k
06-29-2003, 06:17 AM
Unfortunately though you'll have to live with it regardless. Too many people using IE... and they won't change their ways as there is no need to.

modihost
06-29-2003, 06:32 AM
i just installed mozilla 1.4 RC3 and they fixed the ALT tag not displaying as a tool tip - i think its been a bug for like 5 point releases and now they fixed it, it was getting annoying not having tool tips with alt tags because i use them a lot - mozilla too :)