JSFiddle - React, Tailwind, and code Playground
by Bartek Legięć
HTML
<div class="wrapper">
<header></header>
<main>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</main>
<footer>© John Doe</footer>
</div>
CSS
.wrapper {
display: grid;
grid-template-columns: 1fr 70vw 1fr;
grid-template-rows: auto 1fr auto;
min-height: 100vh;
}
header {
grid-column-start: 1;
grid-column-end: 4;
/* also could be written like: grid-column: 1 / 4 */
}
main {
grid-column-start: 2;
}
footer {
grid-column-start: 1;
grid-column-end: -1;
/* also could be written like: grid-column: 1 / -1 */
}
body {
margin: 0;
font-family: "Noto Serif";
font-size: calc(16px + .25vw);
}
header {
background: #673AB7;
width: 100%;
height: 64px;
}
footer {
background: #673AB7;
text-align: center;
padding: 1em;
box-sizing: border-box;
color: #fff;
}