> CSS Video Backgrounds

// 231 words // 1 minute read

CSS Video Backgrounds

With the release of Safari 11.1 on macOS and Safari on iOS 11.3, developers now have the ability to support background videos (mp4 support only - at the time of this article) with pure CSS.


.video-background {
    background-image: url('path-to-video.mp4);

See it in action

Check out the very basic CodePen I created below to see it live (make sure you view it in latest Safari or else you won’t see anything :P)

See the Pen CSS Video Background (Safari Only) by Bradley Taunt (@bradleytaunt) on CodePen.

You can read up on all the new features implemented in 11.1 Safari here:

New WebKit Features in Safari 11.1

Leave a comment

To make a comment, please send an e-mail using the button below. Your e-mail address won't be shared and will be deleted from my records after the comment is published. If you don't want your real name to be credited alongside your comment, please specify the name you would like to use. If you would like your name to link to a specific URL, please share that as well. Thank you.

Comment via email