On Sat, Apr 12, 2008 at 8:46 AM, Pentasis <[EMAIL PROTECTED]> wrote:
> Can anyone tell me why this happens?
>
> The HTML looks like this:
>
> <body>
> <pre><code>some text</code></pre>
> </body>
>
> If the CSS is like:
>
> body {
> font-size: 0.875em; /* computes to 14px */
> line-height: 1.5em;
> }
Hah! I was dealing with precisely this problem a little while ago in
my as yet unfinished site redesign. I've been collecting notes to
write a post about it as soon as I get the redesign up (it won't make
any sense until then). I'm even using the same math as you.
Here's the trick: both the code and pre elements are rendered by
Firefox as monospace if you do not set a font-family. Since the
default setting is to display monospaced fonts at 13px instead of 16px
you end up with a font that is reduced from 13px (13px x 0.875 =
11.4px).
What I ended up doing was adding font-family: inherit to my pre
styles. I guess it works if you define an actual font too.
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/