html - Different behavior on <pre><code> -
i using google prettify highlight code on website. html 5 conform use:
<pre class="prettyprint"><code class="language-java"></code></pre>
to modify used font , size added css:
code { font: normal 400 1.2rem/1.5 'roboto mono', monospace; }
i tested ie-edge , firefox , fine. later have seen, chrome accepting font(-family) not size (bigger expected). while ie , firefox inherited the size <html>
expected.
meanwhile made small workaround , additionaly added:
pre { font: normal 400 1.2rem/1.5 'roboto mono', monospace; }
using <pre>
alone no option, because ie , firefox don't accept font(-family), while chrome does, makes size smaller expected.
that ie has different behavior other browsers known, in case chrome acts differently. redundant code used in pre
and code
the "solution here?
sorry, misunderstood intention.<pre>
, <code>
both part of html 5 spec. there no need use both.
for font-related problems, it's bit complicated, see this article.
Comments
Post a Comment