Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Alt Text 1

Status
Not open for further replies.

gpalmer711

IS-IT--Management
May 11, 2001
2,445
GB
I know it is not good practice, however this is not for a site that will be published on the net.

Is there anyway using CSS to stop the alt text being displayed as a "tooltip".

Greg Palmer
Free Software for Adminstrators
 
No. Actually, standards compliant browsers will not show alt as tooltip since that is not the function of that attribute. If you do not want your IE to display your alt value just add title to img and that will be displayed instead:
Code:
<img src="mypic.jpg" width="100" height="100" alt="me and my dog" title="something else" />

or for nothing:

<img src="mypic.jpg" width="100" height="100" alt="me and my dog" title="" />
 
Thanks for your input, I should have been more specific. I help out on the XP forum and we have been asked about stopping the Nasty Ads that are being delivered by using the alt text. I have managed to stop most of this by creating a CSS file and using the accessability function of IE to superceed any site. However I cannot find a way to hide the Alt "tooltip".

Thanks anyway

Greg Palmer
Free Software for Adminstrators
 
that's probably nothing to do with alt text! more likely there is some scumware installed on the computer.

forum760

Chris.

Indifference will be the downfall of mankind, but who cares?
A website that proves the cobblers kids adage.
Nightclub counting systems

So long, and thanks for all the fish.
 
Hi Chris,
No, there is a new way of showing adverts, this basically involves using javascript to check a webpage's content against a list of known words. Adverts are then displayed based on that content.
These ads are displayed basically using the MouseOver javascript and I have stopped these using the CSS method of hiding the style that this ad company uses.
However the user also stated that he hates the alt/title "tooltips" that appear and wondered if I could help him with that.
Had it been any other browser I could have used

Code:
img[alt] {
display: none !important;
}

to hide the alt text, same with title.

Unfortunatly IE does not seem to recognise it. :-(

Greg Palmer
Free Software for Adminstrators
 
OK then... try this IE hack:
Code:
<style type="text/css">
img 
{	background: expression(this.alt='');
}
</style>
<img src="blah.jpg" height="200" width="200" alt="Click here join now blah blah">
<img src="blah.jpg" height="200" width="200" alt="We want your money!">
I used background property because it is likely useless for images.
 
vongrunt,

Thats just what I wanted, however I changed the this.alt to this.title and it worked perfectly.

Thanks

Greg Palmer
Free Software for Adminstrators
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top