<article>
<h1>Relative <code><code></code> sizing with EMs</h1>
<p>By using an <code>EM</code> value for <code><code></code> samples in text: regardles of what <code>font-size</code> the code sample finds itself in, it’ll be relatively sized</p>
</article>
code {
font-size: 1.2em;
color: #7E1946;
font-weight: 700;
}
/* Presentational styles */
body {
background: #f9f9f9;
color: #17717a;
padding: 1rem;
line-height: 1.4;
min-height: 100vh;
display: grid;
place-items: center;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}
article {
max-width: 75ch;
}
article > * + * {
margin-top: 0.5em;
}
h1 {
font-size: 2rem;
line-height: 1.1;
font-weight: 600;
}
p {
font-size: 1.3rem;
}
This Pen doesn't use any external JavaScript resources.