Scroll To Top

How to set Video Background using pure CSS and HTML

Posted in Code, Design4 months ago • Written by Murtaxa89 Comments
In this tutorial, I will show you how to set video background using pure CSS and HTML.
Codes are available right here:
CSS code(Style):
	<style>
		*{
			margin: 0;
			padding: 0;
		}
		body{
			font-family: Calibri, sans-serif;
		}
		.background-wrap{
			position: fixed;
			z-index: -1000;
			width: 100%;
			height: 100%;
			overflow: hidden;
			top: 0;
			left: 0;
		}
		#video-bg{
			position: absolute;
			top: 0;
			left: 0;
			min-height: 100%;
			min-width: 100%;
		}
		.content{
			position: absolute;
			width: 100%;
			min-height: 100%;
			z-index: 1000;
			background-color: rgba(0,0,0,0.7);
		}
		.content h1{
			text-align: center;
			font-size: 80px;
			text-transform: uppercase;
			font-weight: 300;
			color: #fff;
			padding-top: 20%;
			margin-bottom: 10px;
		}
		.content p{
			text-align: center;
			font-size: 30px;
			color: #aaa;
			letter-spacing: 3px;
		}
	</style>

 

HTML code:
<div class="background-wrap">
		<video id="video-bg" preload="auto" autoplay="true" loop="loop" muted="muted">
			<source src="video.mp4" type="video/mp4">
		</video>
	</div>
	<div class="content">
		<h1>Heading</h1>
		<p>Your Text</p>
	</div>
For more information just watch my video and subscribe.
If you have any question about this tutorial or about HTML, CSS, JavaScript and jQuery please put a comment.
Also let me know what do you want me to show how to make in future tutorials ?
TAGS: , , , , , ,

89 Comments so far. Feel free to join this conversation.

  1. come here March 6, 2017 at 10:59 am - Reply

    5B9T4z please provide feedback and let me know if this is happening to them too?

  2. London venues March 6, 2017 at 5:41 pm - Reply

    Wow, great article.Really looking forward to read more. Cool.

  3. venue finder March 6, 2017 at 6:31 pm - Reply

    I value the blog post.Really looking forward to read more. Really Cool.

  4. tornado March 6, 2017 at 7:24 pm - Reply

    Im grateful for the article post.Thanks Again. Really Cool.

  5. Chana March 6, 2017 at 8:19 pm - Reply

    I really enjoy the article. Fantastic.

  6. tsx this week March 6, 2017 at 9:10 pm - Reply

    Great, thanks for sharing this article. Keep writing.

  7. Replacement Marvin Windows March 6, 2017 at 10:53 pm - Reply

    Really appreciate you sharing this blog post.Much thanks again. Awesome.

  8. Iphone_6 March 6, 2017 at 11:55 pm - Reply

    I’ve bookmarked it in my google bookmarks.

  9. fake news March 7, 2017 at 12:57 am - Reply

    volunteers and starting a new initiative in a community

  10. marketplace classifieds March 7, 2017 at 1:59 am - Reply

    Thorn of Girl Excellent information and facts could be identified on this web blog.

  11. official site March 7, 2017 at 3:02 am - Reply

    Very good article! We will be linking to this particularly great post on our site. Keep up the great writing.

  12. acoustic musician March 7, 2017 at 4:07 am - Reply

    Your style is unique in comparison to other people I ave read stuff from. Thank you for posting when you ave got the opportunity, Guess I will just book mark this web site.

  13. tsx index price March 7, 2017 at 5:12 am - Reply

    naturally like your web-site however you have to check the spelling

  14. tsx 60 components March 7, 2017 at 6:17 am - Reply

    Very interesting information!Perfect just what I was searching for! If you want to test your memory, try to recall what you were worrying about one year ago today. by Rotarian.

  15. gmail account March 7, 2017 at 7:23 am - Reply

    I was suggested this website by my cousin. I am not sure whether this post is written by him as no one else know such detailed about my problem. You are wonderful! Thanks!

  16. arab March 7, 2017 at 7:31 am - Reply

    Enjoyed every bit of your article. Keep writing.

  17. eye care pc March 7, 2017 at 8:44 am - Reply

    Say, you got a nice blog post.Really thank you! Cool.

  18. darceky March 7, 2017 at 9:37 am - Reply

    This excellent website really has all the information and facts I wanted about this subject and didn at know who to ask.

  19. free sports betting picks nhl March 7, 2017 at 10:41 am - Reply

    This paragraph regarding SEO presents clear idea designed for new SEO visitors that how to do SEO, therefore keep it up. Pleasant work

  20. Love Compatibility March 7, 2017 at 11:47 am - Reply

    Utterly written subject matter, appreciate it for selective information.

  21. ICC Cricket World Cup 2019 March 7, 2017 at 12:54 pm - Reply

    This blog is pretty cool. How was it made !?

  22. gmail.com March 7, 2017 at 2:02 pm - Reply

    Very good post.Much thanks again. Fantastic.

  23. secrets to dog training March 7, 2017 at 3:09 pm - Reply

    You have observed very interesting details ! ps nice web site. Loneliness seems to have become the great American disease. by John Corry.

  24. jane and john clothing March 7, 2017 at 4:16 pm - Reply

    Major thanks for the article post.Thanks Again. Will read on

  25. seo agency australia March 7, 2017 at 5:22 pm - Reply

    This awesome blog is definitely interesting and also factual. I have found many handy stuff out of this source. I ad love to come back over and over again. Cheers!

  26. website builder March 7, 2017 at 5:57 pm - Reply

    Muchos Gracias for your blog.Thanks Again. Great.

  27. www.buy-book-reviews.com March 7, 2017 at 6:29 pm - Reply

    There may be noticeably a bundle to learn about this. I assume you made certain nice points in features also.

  28. dominican republic houses March 7, 2017 at 7:36 pm - Reply

    wellness plans could be expensive but it is really really necessary to get one for yourself-

  29. makeup tutorial March 7, 2017 at 8:41 pm - Reply

    Muchos Gracias for your post.Really looking forward to read more. Really Great.

  30. fade,faded March 7, 2017 at 9:46 pm - Reply

    pretty valuable stuff, overall I feel this is really worth a bookmark, thanks

  31. nikon dslr dealer March 7, 2017 at 10:52 pm - Reply

    Your style is unique compared to other people I have read stuff from. Thank you for posting when you ave got the opportunity, Guess I all just bookmark this site.

  32. phuket holiday rentals March 8, 2017 at 12:01 am - Reply

    Thank you ever so for you post.Really thank you! Want more.

  33. cccam pay server March 8, 2017 at 1:13 am - Reply

    This is really interesting, You are a very skilled blogger. I ave joined your feed and look forward to seeking more of your excellent post. Also, I ave shared your website in my social networks!

  34. jouet pas cher March 8, 2017 at 2:22 am - Reply

    You ave made some really good points there. I looked on the internet for more information about the issue and found most individuals will go along with your views on this site.

  35. Android Phones March 8, 2017 at 8:26 am - Reply

    Major thankies for the article.Thanks Again. Great.

  36. Letting Agents in West Bromwich March 8, 2017 at 8:29 am - Reply

    Really appreciate you sharing this blog.Really thank you!

  37. Great, thanks for sharing this blog article. Much obliged.

  38. find properties or search for properties March 8, 2017 at 9:44 am - Reply

    Very clear site, thankyou for this post.

  39. nashville seo March 8, 2017 at 10:53 am - Reply

    Your current positions continually have much of really up to date info. Where do you come up with this? Just declaring you are very imaginative. Thanks again

  40. fashion book review in Italy March 8, 2017 at 12:02 pm - Reply

    Thanks a lot for the article post.Really looking forward to read more. Really Cool.

  41. ar condicionado sp March 8, 2017 at 2:19 pm - Reply

    not everyone would need a nose job but my girlfriend really needs some rhinoplasty coz her nose is kind of crooked*

  42. some truly prime blog posts on this internet site , saved to favorites.

  43. auto insurance quotes ct March 8, 2017 at 4:39 pm - Reply

    When someone writes an paragraph he/she keeps the idea of a

  44. Oud oil supplier March 8, 2017 at 5:46 pm - Reply

    Thank you ever so for you article post.Really thank you!

  45. Website Traffic March 8, 2017 at 6:33 pm - Reply

    Buy Website Traffic from the leading worldwide traffic supplier. Buy Traffic from our trusted USA based company to increase your targeted web traffic today!

  46. EZ Battery Reconditioning Review March 8, 2017 at 6:55 pm - Reply

    Well I really enjoyed reading it. This post procured by you is very constructive for proper planning.

  47. financial freedom March 12, 2017 at 11:26 am - Reply

    Very good blog post.Much thanks again. Awesome.

  48. hibiscusteasite.com March 12, 2017 at 10:59 pm - Reply

    Interesting, but still I would like to know more about it. Liked the article:D

  49. Hotels March 13, 2017 at 12:09 am - Reply

    Many thanks for sharing this good write-up. Very interesting ideas! (as always, btw)

  50. genetic Test March 13, 2017 at 1:19 am - Reply

    It as not that I want to duplicate your web-site, but I really like the pattern. Could you tell me which theme are you using? Or was it tailor made?

  51. Luxury Yacht Charter March 13, 2017 at 2:29 am - Reply

    Very neat blog article.Thanks Again. Keep writing.

  52. twitter promotions March 13, 2017 at 7:35 am - Reply

    Enjoyed every bit of your blog post.Really looking forward to read more. Fantastic.

  53. kamagra March 13, 2017 at 8:47 am - Reply

    Thanks-a-mundo for the blog post.Much thanks again.

  54. Admin March 13, 2017 at 8:57 am - Reply

    Yay google is Yay google is my queen aided me to find this great site!.

  55. Zombie March 13, 2017 at 9:59 am - Reply

    Really informative post.Much thanks again. Really Cool.

  56. windshield repair March 13, 2017 at 11:12 am - Reply

    Hey, thanks for the blog article.

  57. best trading services March 13, 2017 at 1:30 pm - Reply

    Wow, marvelous blog layout! How long have you been

  58. best web server March 13, 2017 at 2:43 pm - Reply

    This is my first time visit at here and i am genuinely impressed to read all at one place.

  59. http://www.electrichainsaw.com March 13, 2017 at 3:35 pm - Reply

    Fantastic article post. Much obliged.

  60. Brisbane Real Estate March 13, 2017 at 3:55 pm - Reply

    I truly appreciate this article.Thanks Again. Much obliged.

  61. minecraft pe furniture mod March 13, 2017 at 5:07 pm - Reply

    This awesome blog is without a doubt interesting and besides factual. I have discovered a lot of useful things out of this amazing blog. I ad love to come back again and again. Thanks a lot!

  62. fun788 March 13, 2017 at 6:19 pm - Reply

    Link exchange is nothing else but it is simply placing the other person as web site link on your page at suitable place and other person will also do same for you.

  63. red carnation hotel collection March 14, 2017 at 8:02 am - Reply

    A round of applause for your blog post.Thanks Again. Really Great.

  64. Review Wizard Review March 14, 2017 at 1:46 pm - Reply

    You got a very superb website, Gladiolus I detected it through yahoo.

  65. where to find weed March 14, 2017 at 3:01 pm - Reply

    Right now it looks like BlogEngine is the top blogging platform available right now. (from what I ave read) Is that what you are using on your blog?

  66. Bitcoin Mining March 14, 2017 at 4:29 pm - Reply

    Pretty! This has been an incredibly wonderful post. Thanks for supplying these details.

  67. vestidos ni�a fiesta March 14, 2017 at 5:41 pm - Reply

    Very fantastic info can be found on website.

  68. Jual Facebook Like March 14, 2017 at 9:06 pm - Reply

    Way cool! Some very valid points! I appreciate you penning this post and also the rest of the site is extremely good.

  69. schelder veere March 14, 2017 at 10:19 pm - Reply

    It is truly a nice and useful piece of information.I

  70. Trump�s Immigration Ban March 15, 2017 at 12:43 am - Reply

    sex is pretty hot topic at the moment. I was just talking to my brother about the exact same issue the other day.

  71. potenzmittel rezeptfrei online March 15, 2017 at 10:44 am - Reply

    Thanks so much for the article post. Keep writing.

  72. vinhomeshcm March 15, 2017 at 10:50 am - Reply

    Thanks a lot for the blog.Much thanks again. Great.

  73. Sabine Schenk Betrug March 15, 2017 at 1:41 pm - Reply

    I truly appreciate this blog article.Really thank you! Much obliged.

  74. Marrakech camel trips March 15, 2017 at 2:56 pm - Reply

    Pretty! This was a really wonderful article. Thank you for supplying this info.

  75. Travel March 15, 2017 at 3:06 pm - Reply

    I truly appreciate this article post.Really thank you! Keep writing.

  76. Exchange Bitcoins to PayPal March 15, 2017 at 4:12 pm - Reply

    Thanks for sharing, this is a fantastic post. Really Cool.

  77. click here March 15, 2017 at 5:25 pm - Reply

    Fantastic blog article.Really thank you! Awesome.

  78. ebaydroplister March 15, 2017 at 5:25 pm - Reply

    It is pretty worth enough for me. In my view, if all

  79. for more information March 15, 2017 at 5:58 pm - Reply

    I really liked your article.Really looking forward to read more. Fantastic.

  80. Aline March 15, 2017 at 6:38 pm - Reply

    Major thanks for the post.Thanks Again. Really Great.

  81. male sex pills March 15, 2017 at 7:51 pm - Reply

    I will immediately grab your rss as I can not find your email subscription link or e-newsletter service. Do you ave any? Please let me know in order that I could subscribe. Thanks.

  82. nursing jobs March 16, 2017 at 7:21 am - Reply

    Say, you got a nice post.Much thanks again. Will read on…

  83. Mortgage Lender March 16, 2017 at 7:55 am - Reply

    Looking forward to reading more. Great article. Keep writing.

  84. Michelle March 16, 2017 at 9:41 am - Reply

    You completed various nice points there. I did a search on the subject matter and found a good number of persons will agree with your blog.

  85. socialdad March 16, 2017 at 10:55 am - Reply

    Perfectly pent written content, Really enjoyed reading.

  86. modern March 16, 2017 at 12:09 pm - Reply

    wow, awesome blog article.Really looking forward to read more. Fantastic.

  87. play online casino March 16, 2017 at 1:27 pm - Reply

    Your style is really unique in comparison to other folks I have read stuff from. Thank you for posting when you ave got the opportunity, Guess I all just book mark this page.

  88. las vegas March 16, 2017 at 2:42 pm - Reply

    Is that this a paid subject or did you customize it your self?

  89. earning with products March 16, 2017 at 3:58 pm - Reply

    I wish I had a dime for every bad article I ave read lately. I also wish other writers had your talent and style. Thank you.

Leave A Response