<div class="wrapper">
<a href="#">One</a>
<a href="#">Two</a>
<a href="#">Three</a>
<a href="#">Four</a>
<a href="#">Five</a>
<a href="#">Six</a>
<a href="#">Seven</a>
<a href="#">Eight</a>
<a href="#">Nine</a>
<a href="#">Ten</a>
<a href="#">Eleven</a>
<a href="#">Twelve</a>
</div>
.wrapper {
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-auto-rows: 100px;
reading-flow: grid-rows;
}
.wrapper a:nth-child(2) {
grid-column: 3;
grid-row: 2 / 4;
}
.wrapper a:nth-child(5) {
grid-column: 1 / 3;
grid-row: 1 / 3;
}
@import url("https://fonts.googleapis.com/css2?family=Alegreya+SC:ital,wght@0,400;0,500;0,700;0,800;0,900;1,400;1,500;1,700;1,800;1,900&family=Alegreya:ital,wght@0,400..900;1,400..900&family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap");
:root {
--primary: #444;
--text: #fff;
}
body {
font: 1.2em Nunito, serif;
margin: 0;
padding: 20px;
}
h1,
h2,
h3,
h4 {
font-family: Alegreya, serif;
}
a:link,
a:visited {
color: #003566;
}
.wrapper {
background-color: #fff;
gap: 2px;
}
.wrapper a:link,
.wrapper a:visited {
background: var(--primary);
color: #fff;
text-decoration: none;
padding: 0.5em;
}
.wrapper a:hover,
.wrapper a:active,
.wrapper a:focus {
background-color: #ffd166;
color: #000;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.