0
点赞
收藏
分享

微信扫一扫

【webrtc】ProcessThreadAttached

Python芸芸 2023-07-13 阅读 38

(vue)整个页面添加背景视频


在这里插入图片描述


App.vue

<template>
  <div id="app" :class="[platform]">
    <video src="./assets/images/top/bg-video-711.mp4" autoplay muted loop class="bg"></video>
    <router-view />
  </div>
</template>

css

<style lang="less">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  //   text-align: center;
  color: #2c3e50;
}
video.bg {
  position: fixed;
  /* 视频绝对定位 */
  top: 0;
  left: 0;
  width: 100%;
  /* 宽度占据整个屏幕 */
  height: 100%;
  /* 高度占据整个屏幕 */
  object-fit: fill;
  /* 填满整个容器,可能会裁剪视频 */
}

.bg {
  width: 100%;
  height: 100%;
}
...
</style>
举报

相关推荐

0 条评论