1rem not always equal to 16px

Viewed 2023

Lets say I have the following HTML:

<h1>Heading</h1>

And the following CSS:

h1{
    font-size: 1rem;
}

The default size for 1rem in my browser (chrome) is 16px, but whilst inspecting the element, I noticed that the height of the h1 was actually 18px, not 16px, so is something wrong here, or is this intentded, and how do I set it to 16px?

1 Answers
Related