W3C home > Mailing lists > Public > w3c-wai-ig@w3.org > April to June 2003

Re: image rollovers in css. what is content and what is presentation. background vs foreground.

From: David Woolley <david@djwhome.demon.co.uk>
Date: Wed, 21 May 2003 22:58:01 +0100 (BST)
Message-Id: <200305212158.h4LLw1M00713@djwhome.demon.co.uk>
To: w3c-wai-ig@w3.org

> I have been thinking of ways to create the image rollover effect for
* links using css instead of java script.  That is, where an image link

There was a technique for this published on one of the W3C lists (possibly
the styles one) a few months ago.  I'm sure it was not this one, as
I seem to remember that it was consistent with HTML philosophy.  It doesn't
do text as graphics, though.

> This leads me to a philosophical question of what is content and what
* is presentation.  Most may agree that images on a page are examples of

Nothing in background images, by whatever means introduced, is content
for HTML (it might be for PDF, but PDF doesn't have a background
image concept; it just uses a painter algorithm).  The page must
operate with nothing except the foreground present.

* "content", and the way they are laid out etc is the "presentation".
* In the case of JavaScript rollover images, the images are part of the
* content in  a way.  But it seems that css examples like mine above pushes

More accurately, the image placeholder and default image are part of
the foreground, and the alternative image is not really part of the
document at all.

* these images into the realm of "presentation".  This may be ok for some
* cases, but what if the images contain information that is important?
* i.e. part of the content as is the case with normal static images on
* a page?

Although I've seen people put content into background images, the result
was fragile across browsers, even with images on, and is certainly an
abuse of HTML.

> 
> If css is to be used, how can alternative text be provided for such
* images?  Is the use of JavaScript therefore ultimately a better way of
* doing this roll over effect than css?

I think you are tieing yourself in knots by trying to use HTML to do
something that HTML is not designed to do.  Also note that all CSS is
only hints, so the browser need not honour all of it, and, in particular,
it is fairly common to have a browser option to disable images, which may
well not disable invisibility.
Received on Wednesday, 21 May 2003 17:58:06 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 19 July 2011 18:14:09 GMT