gengns ES

An entry from the gengns log, written by Génesis García Morilla · · CSS3

CSS Responsive Square

I have seen many weird ways to create responsive squares, that’s why I would like to share an easy one. Go to JSFiddle and play resizing the result window.

CSS

div {
    width: 60vw;
    height: 60vw;
    margin: 20vh auto;
    background-color: #774C60;
}

HTML

<div></div>
Open in JSFiddle

Tags: square, viewport