The default font-size
of my code is set to 10px
or 0.625em
. According to this, to make the font size of <p>
7px, I should use 0.7em
. However, in my case, the browser is consistently using a fixed font size of 9px
, even when I decrease the font size of <p>
to 0.5em
or lower.
https://i.sstatic.net/7vqRv.png
body {
font-size: 0.625em;
}
h1 {
font-size: 2.5em;
}
h2 {
font-size: 1.875em;
}
p {
font-size: 0.7em;
}
<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<p>This is a paragraph.</p>
<p>Specifying the font-size in em allows all major browsers to resize the text.
Unfortunately, there is still a problem with older versions of IE. When resizing the text, it becomes larger/smaller than it should.</p>