宽度设为100%没啥问题。 但高度是如何设置的呢。固定比例
<style>
.myvideo {
width: 100%;
height: auto;
}
</style>
<video class="myvideo">
<source></source>
</video>
如果是视频固定比例 @duckywang1 的回答就可以了
如果是要区域固定比例的话
<style>
section {
width: 100%;
height: 0;
padding-top: 75% /* 4:3 */
position: relative;
}
section video {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
</style>
<section>
<video />
</section>