On Thu, Jun 30, 2011 at 9:37 PM, Philippe Wittenbergh <e...@l-c-n.com> wrote:
>
> On Jul 1, 2011, at 10:53 AM, Mark Volkmann wrote:
>
>> Are :hover and :focus the only ways that CSS can change something
>> based on user interaction?
>
> And :active
> http://www.w3.org/TR/css3-selectors/#the-user-action-pseudo-classes-hover-act
>
>> I realize that there are many more ways that involve JavaScript.
>> It would be interesting if there was a :click pseudo-class so CSS
>> properties of a clicked element could be changed.
>
> :active ?
>
> Limited to elements defined as interactive, though (buttons, links).

I used this on a div and it seems to work. Unfortunately the effects
are only retained while the mouse button is down. They go away when it
is released. I found this in the CSS "Selectors Level 3"
Recommendation:

"The :active pseudo-class applies while an element is being activated
by the user. For example, between the times the user presses the mouse
button and releases it. On systems with more than one mouse button,
:active applies only to the primary or primary activation button
(typically the "left" mouse button), and any aliases thereof."

I suppose if I want changes to be retained after the mouse button is
released then I need to write some JavaScript.

-- 
R. Mark Volkmann
Object Computing, Inc.
______________________________________________________________________
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to