How to create a background video | HTML & CSS tutorial

Kevin Powell
Kevin Powell
76.8 هزار بار بازدید - 5 سال پیش - If this doesn't work on
If this doesn't work on iOS, try adding the 'playsinline' attribute.

While background-images are really easy, there is no simple way to do a background video. In this video I explore how to set up a background video with HTML and CSS, including a few different tricks on positioning it.

One thing to note is, while these are really trendy, be careful with them. They aren't exactly considered best practice. Auto-playing videos are generally seen as something to be avoided, and it can add a ton of weight to your site. But that said, it is good to know how to do it :)

#html #css #backgroundvideo

---
Come and hangout, ask questions, suggest ideas, and meet some awesome people over in The Community: Discord: discord

I have a newsletter! https://www.kevinpowell.co/newsletter

I've been working on some courses! Find out more: https://www.kevinpowell.co/courses

---

My Code Editor: VS Code - https://code.visualstudio.com/

How my browser refreshes when I save: How to automatically refresh your bro...

---

Support me on Patreon: Patreon: kevinpowell

I'm on some other places on the internet too!

If you'd like a behind the scenes and previews of what's coming up on my YouTube channel, make sure to follow me on Instagram and Twitter.

Instagram: Instagram: kevinpowell.co
Twitter: Twitter: KevinJPowell
Codepen: https://codepen.io/kevinpowell/
Github: https://github.com/kevin-powell
5 سال پیش در تاریخ 1398/06/27 منتشر شده است.
76,858 بـار بازدید شده
... بیشتر