如何使用 css 更改 Html 视频的大小
How to change size of Html video with css
我想知道如何仅使用 css 更改 html 视频的 width/height。我是否需要做一些与人们通常使用 css 调整对象大小不同的事情,还是我可以按正常方式进行。
<!DOCTYPE html>
<html>
<body>
<video width="320" height="240"controls>
<source src="mov_bbb.mp4" type="video/mp4">
<source src="mov_bbb.ogg" type="video/ogg">
Your browser does not support HTML5 video.
</video>
<p>
Video courtesy of
<a href="https://www.bigbuckbunny.org/" target="_blank">Big Buck Bunny</a>.
</p>
</body>
</html>
#vid {
width: 500px;
height: 500px;
}
<!DOCTYPE html>
<html>
<body>
<video controls id="vid">
<source src="mov_bbb.mp4" type="video/mp4">
<source src="mov_bbb.ogg" type="video/ogg">
Your browser does not support HTML5 video.
</video>
<p>
Video courtesy of
<a href="https://www.bigbuckbunny.org/" target="_blank">Big Buck Bunny</a>.
</p>
</body>
</html>
我想知道如何仅使用 css 更改 html 视频的 width/height。我是否需要做一些与人们通常使用 css 调整对象大小不同的事情,还是我可以按正常方式进行。
<!DOCTYPE html>
<html>
<body>
<video width="320" height="240"controls>
<source src="mov_bbb.mp4" type="video/mp4">
<source src="mov_bbb.ogg" type="video/ogg">
Your browser does not support HTML5 video.
</video>
<p>
Video courtesy of
<a href="https://www.bigbuckbunny.org/" target="_blank">Big Buck Bunny</a>.
</p>
</body>
</html>
#vid {
width: 500px;
height: 500px;
}
<!DOCTYPE html>
<html>
<body>
<video controls id="vid">
<source src="mov_bbb.mp4" type="video/mp4">
<source src="mov_bbb.ogg" type="video/ogg">
Your browser does not support HTML5 video.
</video>
<p>
Video courtesy of
<a href="https://www.bigbuckbunny.org/" target="_blank">Big Buck Bunny</a>.
</p>
</body>
</html>