<div class="container">
<div class="header">header</div>
<main class="grid">
<div class="numbers">
<div class="place"><div class="place__inner"><div class="place__content">1</div></div></div>
<div class="place"><div class="place__inner"><div class="place__content">2</div></div></div>
<div class="place"><div class="place__inner"><div class="place__content">3</div></div></div>
<div class="place"><div class="place__inner"><div class="place__content">4</div></div></div>
<div class="place"><div class="place__inner"><div class="place__content">5</div></div></div>
<div class="place"><div class="place__inner"><div class="place__content">6</div></div></div>
<div class="place"><div class="place__inner"><div class="place__content">7</div></div></div>
<div class="place"><div class="place__inner"><div class="place__content">8</div></div></div>
<div class="place"><div class="place__inner"><div class="place__content">9</div></div></div>
<div class="place"><div class="place__inner"><div class="place__content">10</div></div></div>
<div class="place"><div class="place__inner"><div class="place__content">11</div></div></div>
<div class="place"><div class="place__inner"><div class="place__content">12</div></div></div>
<div class="place"><div class="place__inner"><div class="place__content">13</div></div></div>
<div class="place"><div class="place__inner"><div class="place__content">14</div></div></div>
<div class="place"><div class="place__inner"><div class="place__content">15</div></div></div>
<div class="place"><div class="place__inner"><div class="place__content">16</div></div></div>
</div>
</main>
<div class="footer">footer</div>
</div>
* {
font-family: sans-serif;
padding: 0;
margin: 0;
box-sizing: border-box;
}
.container {
min-height: 100vh;
display: flex;
flex-direction: column;
}
.header {
height: 60px;
background: #0D0;
}
.footer {
height: 60px;
background: #D00;
}
.grid {
width: 100%;
max-width: 700px;
margin: 0 auto;
padding: 0 15px;
flex-grow: 1;
display: flex;
justify-content: center;
align-items: center;
}
.numbers {
margin: 0 auto;
flex-grow: 1;
display: flex;
flex-wrap: wrap;
}
.place {
flex: 0 1 calc(100% / 4 - 10px);
margin: 5px;
background: #DDD;
}
.place__inner {
position: relative;
height: 0;
padding-bottom: 100%;
}
.place__content {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.