CSS bug: font-family: monospace in tables = Courier New, always

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

On Windows 2000 SP4 and Windows XP SP2, Internet Explorer 6.0 SP1 seems to be
incapable of using the user-specified monospace font (as selected in Internet
Options) for the monospace font in tables. Here is a web page that
demonstrates the problem: http://skew.org/xml/specs/iso-646-c0.html - go to
your Internet Options and choose, say, Lucida Console for your monospace
font. The text above the table will appear in this font, but the text in the
table will be Courier New, even though no font families other than
'monospace' are specified in the document's CSS.

I tried Googling for info on this bug did not find any examples of it.
Surely it has been noticed before?

Can anyone with IE7 beta tell me if they get the same results?

Thanks,
Mike
 
Mike said:
On Windows 2000 SP4 and Windows XP SP2, Internet Explorer 6.0 SP1 seems to be
incapable of using the user-specified monospace font (as selected in Internet
Options) for the monospace font in tables. Here is a web page that
demonstrates the problem: http://skew.org/xml/specs/iso-646-c0.html - go to
your Internet Options and choose, say, Lucida Console for your monospace
font. The text above the table will appear in this font, but the text in the
table will be Courier New, even though no font families other than
'monospace' are specified in the document's CSS.

I tried Googling for info on this bug did not find any examples of it.
Surely it has been noticed before?

You have to realize that, for IE, there are two classes of fonts: the
fonts used if a page specifies no fonts at all; and the fonts used if
the page specifies fonts using CSS. The two are not tied together.
E.g., if you configure IE so that Lucida Console is the default
monospace font, this is the font that is used if the page specifies no
font and the browser decides that text should be monospace; it may or
may not be the same font that the browser picks as its default CSS
monospace font.

Worse, unlike all the other popular browsers, IE does not allow you to
specify what the default CSS fonts are. This can be a problem, because
IE sometimes picks a font that is wildly inappropriate for its default
CSS fonts: tricking IE into picking a more appropriate font is a bit
tricky.
 
Hi Mike. There are 2 font settings on the Internet Options font dialog. Web
Page Fonts and Plain Text Fonts. It seems that a Plain Text Font is being
applied to the text that is above the table in your example, even though the
text is within a <div> tag!

Perhaps this is a feature of IE6 and not a bug!

This blog thread outlines the css features that the IE7 team are addressing

http://blogs.msdn.com/ie/archive/2005/07/29/445242.aspx

FYI you may also like to visit

http://www.positioniseverything.net/

http://www.quirksmode.org/
 
Rob Parsons said:
Hi Mike. There are 2 font settings on the Internet Options font dialog. Web
Page Fonts and Plain Text Fonts. It seems that a Plain Text Font is being
applied to the text that is above the table in your example, even though the
text is within a <div> tag!

Actually, that's correct, because the div has class="main", and I've got
that class set in the CSS to use font-family: monospace.

The table is contained in that same div, so it should get the same
treatment, but it doesn't (well, it does get assigned a monospace font, but
it's strictly Courier New, not the font I set) ... I've even gone to the
trouble of specifying monospace for the th and td elements, to no avail. If I
replace the monospace with a specific font, then it does apply that font to
everything as it should. So something is amiss with how it handles
'monospace'.
This blog thread outlines the css features that the IE7 team are addressing

http://blogs.msdn.com/ie/archive/2005/07/29/445242.aspx

I've been keeping up with IEBlog, and didn't see anything about it noted
there, nor did it turn up in a Google search, which is why I am asking about
it here.
 
C A Upsdell" <""cupsdellXXX"@-@-@XXXups said:
You have to realize that, for IE, there are two classes of fonts: the
fonts used if a page specifies no fonts at all; and the fonts used if
the page specifies fonts using CSS. The two are not tied together.
E.g., if you configure IE so that Lucida Console is the default
monospace font, this is the font that is used if the page specifies no
font and the browser decides that text should be monospace; it may or
may not be the same font that the browser picks as its default CSS
monospace font.

Ah, after some experimentation, I see what you are saying . 'pre', 'tt', and
'code' are displayed using the user's preferred monospace font by default,
but any element that has font-family: monospace specified is going to show up
as Courier New, apparently.

The interaction is quite strange, as the following code demonstrates. 1-4
look OK, but the rest are crazy. 5-11 are stuck as Courier New, and 7-8 are
in a smaller point size for some reason. See it in action temporarily at
http://skew.org/tmp/monospace.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>CSS monospace test</title>
<style type="text/css" media="screen">
..mono { font-family: monospace; color: green }
</style>
</head>
<body>
<div class="normal">
<p>1. This should be in the regular font.</p>
<pre>2. This should be in the preferred monospace font.</pre>
<p><tt>3. This should be in the preferred monospace font.</tt></p>
<p><code>4. This should be in the preferred monospace font.</code></p>
<p class="mono">5. This should be in the preferred monospace font, green.</p>
<p style="font-family: monospace">6. This should be in the preferred
monospace font.</p>
<pre style="font-family: monospace">7. This should be in the preferred
monospace font.</pre>
<p><tt style="font-family: monospace">8. This should be in the preferred
monospace font.</tt></p>
<p><tt class="mono">9. This should be in the preferred monospace font,
green.</tt></p>
<table>
<tr><td>10. This should be in the regular font.</td></tr>
</table>
<table class="mono">
<tr><td>11. This should be in the preferred monospace font, green.</td></tr>
</table>
<table>
<tr><td class="mono">12. This should be in the preferred monospace font,
green.</td></tr>
</table>
</div>
<div class="mono">
<p>13. This should be in the preferred monospace font, green.</p>
<p class="mono">14. This should be in the preferred monospace font, green.</p>
<table>
<tr><td>15. This should be in the preferred monospace font, green.</td></tr>
</table>
<table class="mono">
<tr><td>16. This should be in the preferred monospace font, green.</td></tr>
</table>
<table>
<tr><td class="mono">17. This should be in the preferred monospace font,
green.</td></tr>
</table>
</div>
</body>
</html>
 
Mike Brown said:
On Windows 2000 SP4 and Windows XP SP2, Internet Explorer 6.0 SP1 seems to be
incapable of using the user-specified monospace font (as selected in Internet
Options) for the monospace font in tables. Here is a web page that
demonstrates the problem: http://skew.org/xml/specs/iso-646-c0.html - go to
your Internet Options and choose, say, Lucida Console for your monospace
font. The text above the table will appear in this font, but the text in the
table will be Courier New, even though no font families other than
'monospace' are specified in the document's CSS.

I tried Googling for info on this bug did not find any examples of it.
Surely it has been noticed before?

Can anyone with IE7 beta tell me if they get the same results?


Can you provide a better example?
This page has fonts which are clearly determined by the content provider.
Use the Accessibility dialog's Ignore font styles specified on web pages
option to see this. (Keystrokes to toggle setting: Alt-T,O,Alt-e,s)
Hence, your preference for Lucida Console (or anything else)
would be irrelevant unless *all* font specifications in the page were ignored.

Thanks,
Mike


HTH

Robert Aldwinckle
---
 
Back
Top