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.

Example:

.video-background {
background-image: url(‘path…


This content originally appeared on Ugly Duck and was authored by Bradley Taunt

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.

Example:

.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


This content originally appeared on Ugly Duck and was authored by Bradley Taunt


Print Share Comment Cite Upload Translate Updates
APA

Bradley Taunt | Sciencx (2018-04-16T00:00:00+00:00) CSS video backgrounds. Retrieved from https://www.scien.cx/2018/04/16/css-video-backgrounds/

MLA
" » CSS video backgrounds." Bradley Taunt | Sciencx - Monday April 16, 2018, https://www.scien.cx/2018/04/16/css-video-backgrounds/
HARVARD
Bradley Taunt | Sciencx Monday April 16, 2018 » CSS video backgrounds., viewed ,<https://www.scien.cx/2018/04/16/css-video-backgrounds/>
VANCOUVER
Bradley Taunt | Sciencx - » CSS video backgrounds. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2018/04/16/css-video-backgrounds/
CHICAGO
" » CSS video backgrounds." Bradley Taunt | Sciencx - Accessed . https://www.scien.cx/2018/04/16/css-video-backgrounds/
IEEE
" » CSS video backgrounds." Bradley Taunt | Sciencx [Online]. Available: https://www.scien.cx/2018/04/16/css-video-backgrounds/. [Accessed: ]
rf:citation
» CSS video backgrounds | Bradley Taunt | Sciencx | https://www.scien.cx/2018/04/16/css-video-backgrounds/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.