I need to create a square with 100% scaling in height and width according to the height and so that it always maintains the aspect ratio.
Illustration example:

A popular example of scaling a square div is width ( https://spin.atomicobject.com/2015/07/14/css-responsive-square/ ). I would like to solve this with CSS / flexbox, but I cannot find the right solution. (IE and legacy browser support are not important)
There must be more than one element in the same style. I tried drawing it, but I don't know if that makes sense. Separate squares should correspond to external divs, but three squares should not be the same size - rather, they are suitable for their individual external div.

, , , - . , . / jquery - waaaay, . : 100% + width: auto, , , ( , , , , ), etcetcetc!!:)
, , .