How to get an element to fit within its parent?
I'm working on a simple layout: https://codepen.io/u3b4/pen/gOZmKmw
The basic structure is something like:
What I want to do is put a
max-width: 100svw
& max-height: 100svh
on the main
element, and then have the children resize to fit within a single screen.
I'm using a columnar flexbox on main
and a regular flexbox on .top
.
Currently the video
is way too big. I've tried object-fit: contain
, but that was no good.
Can someone point me in the right direction?4 Replies
give your video element height nad width of 100% š
I did that: https://codepen.io/u3b4/pen/gOZmKmw
Things shifted a tiny bit, but definitely isn't all on one page.
i would recommend using grid