<div class="square"></div>
<div class="square"></div>
<div class="square"></div>
<div class="square"></div>
<div class="square"></div>
<div class="square"></div>
<div class="square"></div>
<div class="square"></div>
<div class="square"></div>
<div class="square"></div>
<div class="square"></div>
<div class="square"></div>
<div class="square"></div>
<div class="square"></div>
<div class="square"></div>
<div class="square"></div>
.square {
	display: inline-block;
	float: left;
	width: 0;
	height: 0;
	padding: calc(50% - 5px);
	margin: 0 10px 10px 0;
	background: rgb(0, 131, 191);
}

.square:hover {
	background: rgb(213, 126, 0);
}

body {
	max-width: 1200px;
	margin: 10px 0 0 10px;
}

@media(min-width: 360px) {
	.square {
		padding: calc(25% - 5px); 
	}
}

@media(min-width: 480px) {
	.square {
		padding: calc(16.666% - 5px); 
	}
}

@media(min-width: 768px) {
	.square {
		padding: calc(12.5% - 5px); 
	}
}

@media(min-width: 1024px) {
	body {
		margin: 10px auto;
	}
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.