div square code example
Example 1: how to make a responsive box in css
.square {
width: 50%;
}
.square:after {
content: "";
display: block;
padding-bottom: 100%;
}
Example 2: how to make a square div in css
.square {
background-color: #000;
width: 50vw;
height: 50vw;
}
.square h1 {
color: #fff;
}
/* It works */