W3C home > Mailing lists > Public > www-style@w3.org > July 2002

Re: a:hover and a:active and named anchors

From: Stuart Ballard <sballard@netreach.com>
Date: Thu, 25 Jul 2002 17:11:05 -0400
Message-ID: <3D406969.1080409@netreach.com>
To: Jerry Baker <jerrybaker@attbi.com>
CC: www-style <www-style@w3.org>

Jerry Baker wrote:
> 
> I realize that some people may want to apply :hover and :active to
> elements that don't "do" anything (but I can't figure out why). My
> concern is really only that named anchors are matching the a:hover and
> a:active selectors when they did not match in CSS1.

A couple of examples:

div.autoexpand p {display: none}
div.autoexpand:hover p {display: block}

<div class="autoexpand">
   <h2>Sub Heading</h2>
   <p>Text that goes with that subheading, that will only appear when 
the mouse is hovered over the heading. A similar technique could be used 
with table display types to get an expanding menu system that works even 
if the menu headings aren't links themselves. Using this trick with 
fixed, absolute or relative positioning could be used to produce a 
tooltip-like popup effect.</p>
</div>

img.thumbnail {width: 100; height: 100}
img.thumbnail:hover {width: auto; height: auto}

<img class="thumbnail" src="large-image.png" />

I agree that having a:hover and a:active match <a name=""> is a problem 
(and one that we wouldn't have if html had been designed sanely, with 
different elements for different purposes). That's why I suggested new 
pseudoclasses, so that legacy behavior could be preserved for :hover and 
:active, but effects like the above would still be possible.

Stuart.

-- 
Stuart Ballard, Programmer
NetReach - Internet Solutions
(215) 283-2300, ext. 126
http://www.netreach.com/
Received on Thursday, 25 July 2002 17:11:09 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:15 GMT