Skip to content

使用视频作为网页背景

Published: at 10:47 AMSuggest Changes

想做一个背景为视频的页面

下面这篇文章很好

<video playsinline autoplay muted loop poster="polina.jpg" id="bgvid">
  <source src="polina.webm" type="video/webm">
  <source src="polina.mp4" type="video/mp4">
</video>
video {
  object-fit: cover;
  width: 100vw;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
}

Previous Post
技术栈更新:Pinia、Vitest 和 Cypress
Next Post
VS Code 终端中 code 命令失效的解决方法