Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <style>
- .aspect-ratio {
- padding-top: calc(1 / (16 / 9) * 100%);
- position : relative;
- }
- .aspect-wrapper {
- position: absolute;
- top:0;
- left:0;
- width:100%;
- height:100%;
- }
- </style>
- <div class="aspect-ratio">
- <div class="aspect-wrapper">
- Maintains block aspect ratio at different resolutions
- </div>
- </div>
Add Comment
Please, Sign In to add comment