How to create a background video | HTML & CSS tutorial

Опубликовано: 18 Сентябрь 2019
на канале: Kevin Powell
81,525
2.6k

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  

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:   / 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:   / kevinpowell.co  
Twitter:   / kevinjpowell  
Codepen: https://codepen.io/kevinpowell/
Github: https://github.com/kevin-powell


Смотрите видео How to create a background video | HTML & CSS tutorial онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Kevin Powell 18 Сентябрь 2019, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 81,52 раз и оно понравилось 2.6 тысяч людям.