<section class="section">
<div class="section-video-inner">
<h1>content 1</h1>
</div>
<video class="video" src="sample.mp4" autoplay loop muted></video>
</section>
<section class="section skyblue">
<h1>content 2</h1>
</section>
body {
margin: 0;
padding: 0;
}
.section {
display: grid;
place-items: center;
position: relative;
z-index: 2;
width: 100%;
aspect-ratio: 16 / 9;
}
.skyblue {
background: skyblue;
}
.section-video-inner {
display: grid;
place-items: center;
position: absolute;
z-index: 2;
width: 100%;
height: 100%;
background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='2' height='2' fill='white' opacity='0.5'/%3E%3Crect x='2' width='2' height='2' fill='none'/%3E%3C/svg%3E");
background-size: 4px 4px;
}
.video {
width: 100%;
height: 100%;
}
元記事を表示する