The onmousedown event occurs when a user presses a mouse button over an element. Tip: The order of events related to the onmousedown event (for the left/middle mouse button): onmousedown.
The mousedown event is fired at an Element when a pointing device button is pressed while the pointer is inside the element.
A CSS selector is the first part of a CSS Rule. It is a pattern of elements and other terms that tell the browser which HTML elements should be selected to have the CSS property values inside the rule applied to them.
I think you mean the active state
button:active{
//some styling
}
These are all the possible pseudo states a link can have in CSS:
a:link {color:#FF0000;} /* unvisited link, same as regular 'a' */
a:hover {color:#FF00FF;} /* mouse over link */
a:focus {color:#0000FF;} /* link has focus */
a:active {color:#0000FF;} /* selected link */
a:visited {color:#00FF00;} /* visited link */
See also: http://www.w3.org/TR/selectors/#the-user-action-pseudo-classes-hover-act
I figured out that this behaves like a mousedown event:
button:active:hover {}
Pro-tip Note: for some reason, CSS syntax needs the :active
snippet after the :hover
for the same element in order to be effective
http://www.w3schools.com/cssref/sel_active.asp
I recently found out that :active:focus
does the same thing in css as :active:hover
if you need to override a custom css library, they might use both.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With