I was working on a responsive portfolio kind of layout, and I soon realized it's pretty hard to get a responsive square based on the width. I found the perfect solution and will be showing you how to achieve this in CSS and even in Tailwind. The general concept is pretty simple. We want to create a percentage-based width div and use the same percentage as our padding-bottom.

•2m read time• From h.daily-dev-tips.com
Post cover image
Table of contents
CSS Responsive square divTailwind responsive square div
2 Comments

Sort: