Html 创建覆盖整个屏幕的视频容器
我想创建一个覆盖整个屏幕的视频容器 容器内的视频覆盖整个容器,不溢出意味着容器适应整个屏幕大小 并作出相应的反应 目前,这段视频已经达到了最高潮。我不想这样 我希望它的高度限制在屏幕大小,没有滚动 我的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
<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;
}