Blogger Ever

Create perfect square using CSS percentage

A quick tip of create a perfect square with CSS using percentages. Often helpful for fluid and responsive designs.
This is a quick tip of create a perfect square with CSS. The padding is the property which accepts value in percentage, the percentage is relative to the width of the document. It means the percentage of width and setting the padding to the same value with height 0 will return a perfect square. Check the code below:

2013-2016 Copyright Blogger E\ver . Coded, managed and founded by Mohammad Hamza (@hamzadhamiya) . Hosted on Blogger and fonts used are Raleway and Open Sans.