MDN self-hosted library · e01.org

`:picture-in-picture` CSS pseudo-class

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

css
:picture-in-picture {
  /* ... */
}
html
<h1>MDN Web Docs Demo: :picture-in-picture pseudo-class</h1>

<p>
  This demo uses the <code>:picture-in-picture</code> pseudo-class to
  automatically change the style of a video entirely using CSS.
</p>

<video id="pip-video"></video>
css
:picture-in-picture {
  box-shadow: 0 0 0 5px red;
}