Forum Moderators: not2easy

Message Too Old, No Replies

New definition needed: 'a:click'?

just like a:link and a:hover

         

PublicSphere

1:46 pm on May 8, 2007 (gmt 0)

10+ Year Member



It seems to me there should be a style for 'a:click', similar to the onClick command, just like the a:hover, but for a click, rather than a mouse over.

Is there such a thing?

I rarely feel the need for this, but I have a button in a form and I have an image with three different variations of that image at three different heights within the image canvas, so that I can define a:link, a:hover and even 'a:click' (since it's a button), by varying the background-position, in the styles.

(Sorry if my terminology is a bit off by the way)

I used to use onClick and onMouseover before I turned to CSS.

Does anyone know of a a style that stipulates 'a:click' or something similar?

If not, is this an area where CSS could be expanded?

Robin_reala

1:55 pm on May 8, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I believe you're looking for a:active? The :active pseudoclass defines the state where the mouse button is held down while over the element you're targeting.

Dabrowski

3:04 pm on May 8, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ooo thanks Robin, I didn't know that one! I'd have made a JS class changer!

PublicSphere

3:19 pm on May 8, 2007 (gmt 0)

10+ Year Member



awesome, thank you very much - i'd never heard of that one.

They should have called it 'a:click' though, lol.