• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

HTML5+CSS3 - 视频背景的实现

武飞扬头像
wendyGao_Yin
帮助1

<video class="bg-dideo" autoplay loop muted>
    <source src="video/lighthouse.mp4" type="video/mp4">
    Your browser does not support the video tag.
</video>
<!--
autoplay :自动播放
loop :循环播放
muted:静音播放
-->
<style>
/*video*/
video.bg-dideo {
    position: absolute; /*绝对定位,视频的框时相对定位*/
    top: 0;
    right: 0px;
    bottom: 0px;
    left: 0;
    min-width: 100%;
    min-height: 100%;
    height: auto;
    width: auto;
    z-index: -11
}

video.bg-dideo source {
    min-width: 100%;
    min-height: 100%;
    height: auto;
    width: auto;
}

video.video {
    z-index: 10;
    width: 100%;
    height: 100%;
}
</style>
学新通

视频父元素的定位信息。
学新通

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /boutique/detail/tanhgfcieh
系列文章
更多 icon
同类精品
更多 icon
继续加载