WebAIM - Web Accessibility In Mind

E-mail List Archives

RE: "alt" text sizing?!

for

From: Ian.Lloyd
Date: Aug 16, 2002 1:19AM


-----BEGIN PGP SIGNED MESSAGE-----

********************************************************************
The contents of this email are intended exclusively for the
addressee. If you are not the addressee you must not read
use or disclose the email contents ; you should notify us
immediately [ by clicking "Reply" ] and delete this email.

Nationwide monitors e-mails to ensure its systems operate
effectively and to minimise the risk of viruses. Whilst it has
taken reasonable steps to scan this email, it does not
accept liability for any virus that may be contained in it.
********************************************************************

Actually, there is something you can do regarding alt text, but it will only
be supported by browsers with good CSS level 2 - so that's not many of them
(but it does work in Netscape 6 and Mozilla 1). Anyway, here's what you can
do:

I've posted about this in my personal blog at www.ian-lloyd.com, but here's
a copy of it for you here:

- ------------------------------------------
"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 green 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! "


- ------------------------------------------

Hope this is useful


> Ian Lloyd, Electronic Channels
> Nationwide Building Society
>
> |||
> (o o)
> +-------ooO--(_)--Ooo---------+
> | <EMAIL REMOVED> |
> | tel: 01793-655260 |
> | fax: 01793-656368 |
> +-----------------------------+
>


-