How to have a DIV with fixed aspect ratio and max-height? (Pure CSS/no vh or vw)
问题 My initial problem like many others is to keep a DIV A with a fixed aspect ratio (pure CSS/no JS). It is intended to be reused in any parent DIV B regardless the sizing of B. DIV A should fit the smallest size of B. In this animation, you can see the RED div that is always a square and that fits the outermost div smallest size. No vh or vw or vmin or vmax is used and I don't want to use any of them because vh is sometimes no more reliable to really represent the viewport height (see CSS3