Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/89.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 创建覆盖整个屏幕的视频容器_Html_Css_Html5 Video - Fatal编程技术网

Html 创建覆盖整个屏幕的视频容器

Html 创建覆盖整个屏幕的视频容器,html,css,html5-video,Html,Css,Html5 Video,我想创建一个覆盖整个屏幕的视频容器 容器内的视频覆盖整个容器,不溢出意味着容器适应整个屏幕大小 并作出相应的反应 目前,这段视频已经达到了最高潮。我不想这样 我希望它的高度限制在屏幕大小,没有滚动 我的html代码是 <div class="video-container"> <div class="video-wrapper"> <video autoplay controls> <source src="../../asset

我想创建一个覆盖整个屏幕的视频容器

容器内的视频覆盖整个容器,不溢出意味着容器适应整个屏幕大小

并作出相应的反应

目前,这段视频已经达到了最高潮。我不想这样

我希望它的高度限制在屏幕大小,没有滚动

我的html代码是

<div class="video-container">
  <div class="video-wrapper">
    <video autoplay controls>
      <source src="../../assets/movies/joker.mp4" type="video/mp4" />
      Your browser does not support the video tag.
    </video>
  </div>
</div>
请帮我解决这个问题。提前谢谢。

CSS:

* {
    box-sizing: border-box;
  }

  body {
    margin: 0;
    font-family: Arial;
    font-size: 17px;
  }

  video {
    position: fixed;
    right: 0;
    bottom: 0;
    width: 100%; 
    height: 100%;
  }
HTML:

<body>
    <script src="./index.js"></script>
    <video autoplay controls>
        <source src="../../assets/movies/joker.mp4" type="video/mp4">
        Your browser does not support HTML5 video.
    </video>
</body>

您的浏览器不支持HTML5视频。

这样的元标记有助于:

<meta name="viewport" content="width=device-width, initial-scale=1.0">

试着在vh和vw中搜索CSSY你的意思是宽度:100vw?是的,我没有睡过觉^^
<meta name="viewport" content="width=device-width, initial-scale=1.0">
.video-wrapper{
height: 100vh;
width: 100vh;
}