4 ms·
The font-tags are getting unfairly blamed! The increasing size is due to the unclosed <h3> tags combined with unclosed inline level tags. This is parsed into a
by goto11 5y ago
The font-tags are getting unfairly blamed!
The increasing size is due to the unclosed <h3> tags combined with unclosed inline level tags. This is parsed into a nested structure, with h3's nested into h3's deeper and deeper. The font-size of h3 is defined as relative increase, so the nested h3-elements get increasingly larger size.
The effect can be reproduced with this HTML snippet:
<h3><span>hello
<h3><span>hello
<h3>hello
Which is parsed as:
<h3>
<span>hello
<h3>
<span>hello
<h3>hello</h3>
</span>
</h3>
</span>
</h3>
Usually a h3 would be automatically closed when a new h3 (or any block-level element) is encountered, but because of the unclosed inline element (span in the above example) it is instead parsed as a nested structure. In OP it is unclosed font-tags which cause the h3's to nest, but it has nothing to do with the semantics of <font> per se, it is just because they are unclosed.
So why did it look correct in old IE? I think this comes down to the built-in browser style-sheet. I suspect h3 is defined with an absolute font size in the IE browser style sheet which means nesting does not increase the size.