Mike-Ward.Net

PRE/CODE/TT Fonts too small in Firefox

Have you noticed how much smaller the monospaced fonts are in Firefox for the <pre>, <code>, <tt>, <samp> and <kbd> tags? There also a bit small in Opera. As far as I can tell this is a bug. There are some articles that try to explain why this rendering is correct but I don’t buy it. It just plain looks wrong in my opinion. Fortunately, there’s an easy fix for this using style sheets. Add the following to a style sheet:

pre, code, samp, kbd, tt   
{  
    font-family: "Courier New" , monospace;  
    font-size: 100%;  
    font-style: normal;  
    line-height: normal;  
}

I’ve found this to get much more consistent results in IE7, Firefox and Opera.

← newer older →
.Net, Technology, Life, Whatever

Recent Posts

Quick Tip - Clear ReSharper's Cache to Fix False Errors
Quick Tip - Refined GitHub
Vertical Layout for HTML Tables
Visual Studio 2017 Installer Quick Tip
VSColorOutput for VS 2017 Released
Quick ReSharper tip for inline templates
NoSQL vs. NewSQL: What's the Difference?
More... (1077)

Donate with PayPal