I have a parent div with a variable size, and a child div inside with its width set to 100% to fill up the parent div horizontally.
I'd like the height of the child div to be equal to its width at any time, to have an aspect ratio of 1:1 for the child div. The parent div has a different aspect ratio.
How could I achieve that ?