asp.net.ph

Skip Navigation LinksAbakada: Back to Basics > Language References > CSS Properties > Pseudo-Classes > checked Pseudo-class

:checked Pseudo-class


Sets the style of elements in a checked or selected state.

Syntax

selector:checked { property: value; }

Possible Values

property Any valid CSS property.
value Any of the range of values available to the corresponding property.

Remarks

The :checked pseudo-class applies styles to elements that are in a checked or selected state. These include:

The syntax for using the :checked pseudo-class is straightforward. A selector precedes the pseudo-class.

For example, to change the background color of the selected option in a <select> control:

option:checked { background-color: steelblue }

Example

The following demonstrates use of the :checked pseudo-class to set styles for elements whose checked state evaluates to true.

 Show me 

External References

See Also



Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note