Comments on: Fixed Monospace Sizing

Homepage  Xml - Vorschau mit Bildern

By: Dan Q
That’s great hack. Would you say it’s still the best way to fix the sizing in 2023 still?

By: Alex Carey
That’s great hack. Would you say it’s still the best way to fix the sizing in 2021 still?

By: ceving
This solved it for me: <code>pre { fontsize: 1rem; }</code>

By: Dan
That's great hack. Would you say it's still the best way to fix the sizing in 2019 still?

By: Jeremy Thompson
Great information. I know that I have had a problem with this at times on a couple of Wordpress sites. Thanks for sharing! Jeremy @

By: Alan Briolat
Just for extra entertainment value, an issue I'm sure anybody trying the "table method" for highlighted-code-with-line-numbers has come across, italicised Courier New is taller than regular and bold, meaning the numbers never line up... Unfortunately, most people's monospaced font is Courier New! The only workaround I've found is just to not use italics. (While "semantically" more correct, using a numbered list for the lines gives people "unexplained" # symbols when copy-pasting.)

By: Meanwhile in Gotham City ?
[...] Shared Eric’s Archived Thoughts: Fixed Monospace Sizing. [...]

By: mysocialbrain: 09-03-2010 : protagonist
[...] Fixed Monospace Sizing font amusement Name: Required [...]

By: Bobby Jack
Thanks, Eric - this is excellent info for the obsessives amongst us :) I recently discovered a much more basic (though still relatively annoying) inconsistency in IE7's font-size handling, namely that the default user agent styles appear to be applied in absolute sizes (more here: It's staggering that these kinds of issues are not more widely known and understood.

By: Links LXXVI • Peter Kröner, Webdesigner & Frontendentwickler
[...] Fixed Monospace Sizing – Was für ein Zirkus nur um eine Schriftgröße geradezubiegen. Aber hey, immerhin geht [...]

By: links for 2010-02-16 -
[...] Fixed Monospace Sizing Monospace text sizing is, from time to time, completely unintuitive and can be quite maddening if you don’t look at it in exactly the right way. Fortunately, there is a pretty simple workaround, and it’s one you might want to consider using even if you weren’t aware that a problem existed. (tags: css typography fonts 2010 safari) [...]

By: Paul Irish
A chromium developer wrote some great pieces about monospace sizing in webkit.. Some good explanations of this mess:

By: jen
Eric, I sit here after reading this with my face long, my mouth hanging open, feeling like I've been jostled and shoved so many different ways since Tuesday… I can't imagine all you went through to discover and document all of this, and that it didn't make you want to become anything other than a web designer/developer. Now, please, go play with your kids, kiss your wife. Get the hell off that computer!!!

By: JulienW
Is is the same on all platforms ? (ie: Windows/Linux ? I suspect you're using a Mac) Thank you, now I know why my monospaced code doesn't have te same size in IE and other browsers !

By: Carl Meyer
Wow. That is a truly impressive piece of detective work, and I'm glad I did not have to do it.