<aside>
<h2>Aside</h2>
</aside>
<main>
<h2>Main</h2>
</main>
@import url("https://fonts.googleapis.com/css2?family=Exo:wght@600&display=swap");
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
width: 100vw;
min-height: 100vh;
font-family: "Exo", Arial, sans-serif;
background-color: #557;
display: flex;
flex-wrap: wrap;
gap: 20px;
color: #fff;
}
aside,
main {
display: flex;
justify-content: center;
align-items: center;
background-color: #dd3433;
font-size: 2em;
text-shadow: 0 2px 2px rgb(0 0 0 / 0.5);
}
main {
background-color: #478ef0;
}
:root {
--aside-w: 220px;
--gap: 20px;
}
aside {
flex: 1 0 var(--aside-w);
}
main {
flex: 1 1 calc(100% - var(--aside-w) - var(--gap));
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.