W3C home > Mailing lists > Public > www-style@w3.org > March 2001

Re: Interaction with invisible elements

From: Tim Bagot <tsb-w3-style-0002@earth.li>
Date: Fri, 2 Mar 2001 00:11:01 +0000 (UTC)
To: <www-style@w3.org>
Message-ID: <Pine.LNX.4.30.0103012331020.560-100000@windle.hack>
At 2001-03-01T18:04-0500, Eric A. Meyer wrote:-

>     a.easter-egg {visibility: hidden;}
> However, upon trying this I discovered that browsers which make the
> element invisible also prevent me from selecting the link.  In other
> words, the element ceased to be available for interaction, at least
> with my mouse.
>     Should this be the case?  I think not, but I've certainly been
> wrong about CSS before.  If it should, then if we adopt Mozilla's
> 'opacity' into CSS3, will an element be available for interaction
> only so long as its opacity is a nonzero value?

I think the behaviour you report is correct.
<http://www.w3.org/TR/REC-CSS2/visufx.html#visibility> says: "The
'visibility' property specifies whether the boxes generated by an element
are rendered." In particular, not "the content of the boxes...". This
suggests to me that hidden elements affect layout only; for all other
purposes the boxes do not exist, and so there cannot be any link to be
selected. Furthermore, this behaviour is absolutely necessary if links on
revealed boxes with lower z-index(es) are to behave correctly.

What you /could/ do is make a link with no content, and suggest suitable
padding, a transparent background, and no borders, text decoration,
generated content, etc. I think this ought to work.

Opacity is interesting in this context. Making 0 a special case seems
wrong, as you could make the opacity arbitrarily small and achieve
essentially the same effect. This will cause problems when transparent
elements are stacked, but there are already plenty of ways in which style
sheets can have confusing and unhelpful effects. I feel that the topmost
and only the topmost box should be available for interaction (where "box"
should include padding and possibly borders, but not margins), just as if
it were possible to set 'color: transparent'.

Tim Bagot
Received on Thursday, 1 March 2001 19:11:06 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:26:57 UTC