@SempervivumJul 31.2019 — #"of it's parent" - this makes it difficult. Otherwise an easy procedure would be to set width and height both to the same vw value.
Some days ago I found a different procedure which enables for creating a square inside a parent. However it's not straight forward at all:
https://jsfiddle.net/Sempervivum/ryj0c5u3/12/
The trick is using a container that has a padding-top of 100%. As the padding is always a percentage of the width, this makes the container a square.
There is one more disadvantage: The container consists of the padding only and no content can be written inside. To do the latter one needs to create another container.
All things considered this is not a neat procedure. One might consider to set the heigt by javascript.
@codyhillauthorAug 01.2019 — #@Sempervivum#1607011 I also show this, but this doesn't allow for more squares in the same div. One else thing I can do is to set the width to 100% and height on auto and add an img with the height and object-fit cover. But I dont think this would work.