W3C home > Mailing lists > Public > www-style@w3.org > October 2011

[css3-selectors] Clarity to :focus?

From: Brian Kardell <bkardell@gmail.com>
Date: Mon, 10 Oct 2011 12:35:00 -0400
Message-ID: <CADC=+jcPYDqLzPoeMDcQnZH=JGYQSkEOK-EXoCG58c-Wcfqa6g@mail.gmail.com>
To: www-style@w3.org
In a fork of a previous thread I mentioned that I was surprised that :focus
worked differently than :active and :hover...  Given:

        <input class="x"></input>

The following rule will make the background of the div yellow when the input
is hovered:

    div:hover{ background-color: yellow; }

And this one will make the background of the div red when the input is
'clicked' (not exactly, but you get the idea):

    div:active{ background-color: red; }

But this one will never do anything:

    div:focus{ background-color: blue; }

I think you could make a case whether this is correct behavior or not and
rational people could disagree - but given the relationship between and what
is in the current drafts/etc it seems in that in the least, this is less
clear than it could be.

Is it worth suggesting that it should specify that the three should work
similarly in this regard or note specifically how they are different?
 Again, I am not making a case for either, just stating that either course
would probably improve the situation.
Received on Monday, 10 October 2011 17:05:39 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:05 UTC