Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Is possible use active css in a image?? Reply To: Is possible use active css in a image??

#264543
Paulie_D
Member

Yes, it is….but it depends on what you are trying to do

The :active CSS pseudo-class represents an element (such as a button) that is being activated by the user. When using a mouse, “activation” typically starts when the user presses down the primary mouse button and ends when it is released.

Recall that you can’t set :active without pressing the mouse button and at that stage you are already hovering the image.

So your code..is doing the same thing twice.

If you want to make the image half transparent on :hover and then more transparent on :active then you have to have a second opacity setting for the latter.

https://codepen.io/Paulie-D/pen/baggYR