Comments on: Fixed Monospace Sizing

Homepage  Xml - Vorschau mit Bildern

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 @ http://www.thecommerceshop.com

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 ? pseudopost.org
[...] 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: http://www.fiveminuteargument.com/blog/user-agent-font-sizes). 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 - ReFactor.it
[...] 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: http://neugierig.org/software/chromium/notes/2009/04/monospace-fonts.html http://neugierig.org/software/chromium/notes/2009/09/monospace-fonts-workaround.html

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.

By: etienne taylor
Eric, Part of what I do for the dev team here at Clinical Trial Select is the R&D and within that rubric try and chase down solutions for common web development problems so that coders can, well code. This post, which_must have taken a while to write, is a gem. Thank you. etienne taylor ceo clinical trial select, inc.