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 preand codethe "solution here?

<pre> , <code> both part of html 5 spec. there no need use both. sorry, misunderstood intention.

for font-related problems, it's bit complicated, see this article.


Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -