I have a height that has to be a fixed percent.
It cannot be in pixels, it's got to be 20%.
I need the width to adjust to 75% of the height.
All over the place, people are explaining how to use CSS to scale an element's height and preserve width, but I need to scale width and preserve height.
Supposedly using padding-top
will scale height:
.container {
padding-top: 56.25%; /* 16:9 Aspect Ratio (divide 9 by 16 = 0.5625) */
}
But padding-left doesn't do the same thing with width.
Any help?