Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Exactly. The aspect-ratio property works the same way as the padding hack does. It calculates the height based on the rendered width. You can't do it the other way around, even if using a different axis inside a flex or grid element.

You still can't have a div in the middle of the screen, which will have a maximum (intrinsic) width/height, a set aspect ratio, and which will respond to resizing the window vertically. It will simply overflow.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: