CSS :modal Pseudo-class

Definition and Usage

CSS :modal Pseudo-classes are used to select and set the styles of elements in modal state.

Example

Select and set the styles of elements in modal state:

:modal {
  background-color: gold;
  border: 2px solid maroon;
  border-radius: 8px;
  font-size: 20px;
{}

Try It Yourself

CSS Syntax

:modal {
  css declarations;
{}

Technical Details

Version: CSS4

Browser Support

The numbers in the table specify the first browser version to fully support this pseudo-class.

Chrome Edge Firefox Safari Opera
105 105 103 15.6 91