Не показывается видео
.page {
position: relative;
min-height: 100vh;
width: 100%;
}
.page-video {
position: absolute;
left: 0;
top: 0;
bottom: 0;
z-index: 1;
width: 100%;
height: 100%;
overflow: hidden;
}
.page-video:before {
content: "";
display: block;
position: absolute;
left: 0;
top: 0;
bottom: 0;
z-index: 1;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
}
.page-video .video {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
min-width: 100%;
min-height: 100%;
}
.content {
position: relative;
z-index: 2;
}
header{
color: black;
font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
font-size: xx-large;
font-weight: 700;
background-color: white;
text-align: center;
border-radius: 15px;
background: url("Massage.mp4");
}
body{
background-color: black;
}
p{
color: white;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.page {
position: relative;
min-height: 100vh;
width: 100%;
}
.page-video {
position: absolute;
left: 0;
top: 0;
bottom: 0;
z-index: 1;
width: 100%;
height: 100%;
overflow: hidden;
}
.page-video:before {
content: "";
display: block;
position: absolute;
left: 0;
top: 0;
bottom: 0;
z-index: 1;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
}
.page-video .video {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
min-width: 100%;
min-height: 100%;
}
.content {
position: relative;
z-index: 2;
}
header{
color: black;
font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
font-size: xx-large;
font-weight: 700;
background-color: white;
text-align: center;
border-radius: 15px;
background: url("Massage.mp4");
}
body{
background-color: black;
}
p{
color: white;
}
</style>
</head>
<body>
<header> MassagePerfect </header>
<div class="page">
<div class="page-video">
<video class="video" loop="loop" autoplay="" muted="" poster="Massage.mp4">
</video>
</div>
<div class="content">
<h1 class="title">Video background for block</h1>
</div>
</div>
<div id="main">
<p> Хотите получить идеальный массаж от нашей супер-дупер компании?</p>
<p> Позвоните нам - и получите отличную консультацию и записывание на сеанс!</p>
</div>
</body>
</html>
Ответы (1 шт):
Автор решения: BlackStar1991
→ Ссылка
У вашего тега <video>вместо атрибута src="Massage.mp4" задан атрибут poster, замените, и если в той же папке что и ваш html файл лежит видео, оно будет проигрываться.