CSS :fullscreen pseudo-class

The :fullscreen pseudo-class targets elements that are being displayed in full screen mode.

However, take note that the :fullscreen pseudo-class is not intended to work when pressing F11 to enter full screen in the browser.

The way to know if we have entered the full-screen mode is when a message appears on the browser (top or bottom) letting us know that we have entered full-screen mode and that pressing ESC takes us back to the page. We see this when we maximize a video on YouTube or Vimeo.

Example - Note: This demo only works on Chrome and Edge.

The text is injected via CSS