Home › CSS Tutorial › Responsive: viewport and images
Responsive: viewport and images
Make pages and media fit.
Add meta viewport. Use max-width:100%;height:auto for images and aspect-ratio for video frames so they scale.
Example code
<style>.v{width:100%;max-width:320px;aspect-ratio:16/9;background:#14213d;color:#fff;display:grid;place-items:center}</style>
<!-- <meta name='viewport' content='width=device-width, initial-scale=1'> -->
<div class='v'>16:9 box</div>