3 ms·
The old answer, for those curious, was a padding-bottom with the aspect ratio expressed as a percentage: https://jsfiddle.net/9yLkm0tu/ https://jsfiddle.net/9yL
by lelandfe 5y ago
The old answer, for those curious, was a padding-bottom with the aspect ratio expressed as a percentage: https://jsfiddle.net/9yLkm0tu/ https://jsfiddle.net/9yLkm0tu/
This works because padding percentages are calculated based on width – making this, at the time, the only practical way to form a relationship between an element's height and width. Thierry Koblentz coined this "intrinsic ratios" back in '09: https://alistapart.com/article/creating-intrinsic-ratios-for-video/ https://alistapart.com/article/creating-intrinsic-ratios-for...
Some people call it a hack – it's just a narrow application of the spec.