html and css 将视频投射到整个网页作为动态背景cid1097-网页前端设计

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title></title>
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <div class="full-screen">
    <video src="video.mp4" autoplay muted loop></video>
    <div class="content">
      <img src="valorant.png" alt="">
      <a href="https://code.5g-o.com/">Play Now</a>
    </div>
  </div>
</body>
</html>

 

*{
  margin: 0;
  padding: 0;
  font-family: "Open Sans";
  text-decoration: none;
}

.full-screen{
  width: 100%;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.full-screen video{
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
}

.content a{
  display: block;
  margin: 50px auto;
  width: 250px;
  height: 54px;
  line-height: 54px;
  background: #ff4655;
  text-align: center;
  color: #ececec;
  text-transform: uppercase;
  font-weight: 500;
  transition: .4s linear;
}

.content a:hover{
  background: #0f1923;
}

在线演示


让链接同时具备两种打开方式
获取源码: Full Screen Video 2
下载数:206人次, 文件大小: 5.3 MB, 上传日期: 2020年-11月-25日

公众号回复:gcode  获取解压密码

qrcode_for_gh_6ea2c28a1709_258 (1)

3,392 人查阅

一键获取本网站前端代码设计的所有源码

获取资源构建和完善自己的源码库
源码可以在本地直接演示
同时研究和体验 如何将一些具体的想法的实现过程
源码可以直接嫁接到自己的网站里复用
稍作修改成为自己的作品
下载 (4)

您需要先支付 8元 才能查看此处内容!立即支付

类似文章