Last active
May 26, 2017 06:39
-
-
Save xto3na/e2c33e1e51951fc761d198249f168d39 to your computer and use it in GitHub Desktop.
Video background
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>HTML5 видео в качестве заднего фона</title> | |
<link rel="stylesheet" href="style.css"> | |
</head> | |
<body> | |
<video autoplay loop muted poster="video.jpg" class="bgvideo" id="bgvideo"> | |
<source src="video.mp4" type="video/mp4"></source> | |
</video> | |
</body> | |
</html> | |
body { | |
background: url('video.png'); | |
background-size: cover; | |
} | |
.bgvideo { | |
position: fixed; | |
top: 50%; | |
left: 50%; | |
transform: translate(-50%, -50%); | |
min-width: 100%; | |
min-height: 100%; | |
width: auto; | |
height: auto; | |
z-index: -9999; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment