Using The width Property
If the
width
property is set to 100%, the video player will be responsive and scale up and down:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
video {
width: 100%;
height: auto;
}
</style>
</head>
<body>
<video width="400" 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>Resize the browser window to see how the size of the video player will scale.</p>
</body>
</html>
No comments:
Write comments