I came across the :active
element in CSS. This is the Mozilla documentation page of :active
element.
https://developer.mozilla.org/en-US/docs/Web/CSS/:active
They have used this example
form :active {
color: red;
}
form button {
background: white;
}
<form>
<label for="my-button">My button: </label>
<button id="my-button" type="button">Try Clicking Me or My Label!</button>
</form>
I cannot clearly understand why :active
element applies to all of the form elements by giving a delimiter(space) between form
and :active
as in form :active
. How does CSS apply this principle?