Styling alt text
I saw this post today on the <a href="http://www.webaim.org/">webaim</a> discussion list:
"Can you change the size of the text in which that the alt-text appears?" i.e. if you assign alt text to an IMG, and you hover over the image and view the text, is there ANY other way to increase the size of this text!? i.e. style sheets, etc."
Now that got me thinking. As far as I know, there’s no way of changing the display of the tooltip text when you hover over the image, other than directly within Windows (can’t vouch for Mac) - and that would apply to all tooltips, not specific images.
You could, of course, devise some kind of DHTML solution whereby you could call a function that displays the text in a new absolutely positioned floating div, but that’s a bit kludgy.
My argument, though is that if the image is present, there’s no need for the tooltip. Netscape 6 and Mozilla agree - no tooltip appears if the image is present. After all, why describe the image if the image describes itself? Also, assuming that the person browsing is visually imparied, they are more likely to have set Windows to display bigger tooltips anyway.
Nevertheless, there is a solution to the problem raised, or at least similar. You can change the attributes of the alt text for missing images. So, for Netscape 6/Mozilla 1 you can use a CSS level 2 property to affect the appearance of the font when images are either disabled or missing.
Here’s the code:
<style>
img[alt]
{
font-size:large;
color:#000066;
}
</style>
Now try dropping that in to a web page, then break the image src path to give a broken image in Netscape 6/Mozilla 1. You’ll see big navy text where normally you’d expect small black text. Alternatively, if you’re running either of those browsers now, you should see the effect here:
Although the majority of browsers don’t support it now, they surely will at some point - so put it in your CSS and wait for it to magically switch on!
Prague under water
Prague is under water. Yesterday I re-read the diary I wrote from my trip there in 1998. On every page, I found myself thinking – “that’ll be completely flooded now then”. Like the restaurant we ate in at the foot of Charles Bridge, the coffee houses - or Kavarnas - along the riverside. My heart goes out to the people in Prague whose livelihoods and homes will have been wrecked by this incredible flood.
It’s all a haze
Last night I went out. There was a free bar. Now, I don’t feel too good.
There’s a rip on my trousers. I don’t know how it got there.
There’s a strange blood blister on my little finger about 1cm long. Not sure how that happened.
I left my coat behind at the pub. I remembered during the long walk home and phoned up the pub. Except I don’t have the number, and I think I probably told the operator at directory enquiries that I’d be back to pick up the coat today. That confused her. If it was a her …
Now I am achy and not quite myself, and tonight I have my first Karate grading. Damn that infernal thing they call beer!
