Properti modern aspect-ratio: 16 / 9; secara elegan menjaga proporsi video responsif tanpa pembungkus hack kuno.
RWD Videos
Contoh Kode RWD Videos:
<!DOCTYPE html>
<html>
<head>
<style>
.video-player {
width: 100%;
max-width: 500px;
aspect-ratio: 16 / 9;
background: #000;
border-radius: 8px;
}
</style>
</head>
<body>
<video class="video-player" controls>
<source src="https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" type="video/mp4">
</video>
</body>
</html>
Uji dan amati bagaimana deklarasi CSS RWD Videos mengubah tampilan elemen di atas.