W3C home > Mailing lists > Public > site-comments@w3.org > June 2002

Does CSS :active include text selection?

From: Ian B. Jacobs <ij@w3.org>
Date: Mon, 10 Jun 2002 10:00:24 -0400
Message-ID: <3D04B0F8.1080505@w3.org>
To: David Emmerson <david_emmerson@btinternet.com>
CC: site-comments@w3.org, bbos@w3.org

David Emmerson wrote:
> On http://www.w3.org/StyleSheets/TR/W3C-REC, could:
>  :active { color: #C00; background: transparent }
> be changed to:
>  a:active { color: #C00; background: transparent }?
> It's quite annoying when selecting text on a CSS2 browser to have whole
> paragraphs turn red, I'm sure that was not the intended effect of the
> selector.


This is an interesting question. According to section 5.11.3
of the CSS 2 spec [1], the ':active' pseudo-class "applies while an 
element is being activated by the user." I do not believe that the
spec intended to consider text selection as element activation. In
my opinion, your browser should not highlight the paragraph upon
text selection given :active styling. Bert can you comment on this?

Which browser are you using?

Meanwhile, I think we can change our style sheet to the
more specific a:active. I don't think we would lose anything in
doing so.

Thank you,

  _ Ian

[1] http://www.w3.org/TR/REC-CSS2/selector.html#dynamic-pseudo-classes

Ian Jacobs (ij@w3.org)   http://www.w3.org/People/Jacobs
Tel:                     +1 718 260-9447
Received on Monday, 10 June 2002 10:02:58 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:15:31 UTC