I've been searching for solutions to my issue, but none of them have worked for me so far. I am working on a form where users can edit or add images, and I want each image to be displayed as a square regardless of the device being used (desktop, mobile, tablet). However, I haven't been able to achieve this yet. Some suggestions I've come across include using width: 20vw
and height: 20vh
, or utilizing :after
, but none of these methods have solved my problem. I was hoping there might be a solution that doesn't involve creating multiple media queries for different screen sizes.
My goal is to achieve something like this:
https://i.sstatic.net/8pLSj.png
You can check out my codepen here.