I have a problem with rem unit in CSS. In my current project all sizes are rem. When I set an element size (like div), the displayed size is 16 px * (x) ems. But when a div contains text or headings, the displayed size is 19 * (x) ems. This happens in Chrome, FF and IE. Here's an example:
html
<header id="header">
<h1 id="header-title">Blablabla</h1>
<h2 id="header-subtitle">LOL</h2>
</header>
css
#header {
height: 10rem;
padding: 2rem;
text-align: center;
width: 100%;
}
#header-title {
font-size: 3rem;
margin: 0;
}
#header-subtitle {
font-size: 2rem;
margin: 0;
}
Why?
EDIT: I've not declared line-height, by default it was 12.5px. I've searched more and I found the solution: https://stackoverflow.com/a/15135142/3552129