For example we have a div that we want to always keep in shape-ratio(aspect ratio), does CSS/3 have this kind of feature that I don't know about?
Container is 100px wide.
example:
width: 100%;
height: 100%-of-width;
result: div size is 100px wide and 100px high.
example 2:
width: 80%
height: 60%-of-width;
result: div size is 80px wide and 48px high.
Do we have anything like that?
Css already has auto, and vw and stuff like that, there is plenty of hacks but no decent solution yet, or I'm simply not aware of them, any one? We are in 2016 and still no way to overcome the absolute hack with padding. I could simply solve this with JS, but that's different story.
EDIT:
- padding-bottom is not solution, it's work around that forces you to position inner elements in absolute.
- vw is based on screen, it's not appropriate.