:fullscreen pseudo-class
Sets specific CSS properties for an element in full-screen mode.
![]() |
Syntax
selector:fullscreen {...}Parameters
- selector
-
The selector that's displayed in full-screen mode.
Remarks
As of Microsoft Edge, the experimental "ms" prefix was removed from :-ms-fullscreen. The recommended usage is as follows:
| IE Version | Recommended Usage |
|---|---|
| Prior to Internet Explorer 11 | not implemented |
| IE11 | :-ms-fullscreen |
| Microsoft Edge and beyond | :fullscreen |
For improved compatibility with legacy sites, :-webkit-fullscreen is also supported as an alias of :fullscreen.
Examples
The following example changes an element (id=test) to expand to the edges of a screen when the element is displayed in full-screen mode.
#test:fullscreen {
position:absolute;
left:0px;
top:0px;
width: 100%;
height: 100%;
}
See also
Show:
