Is this an MSIE bug?

Tom Schlarman writes:

 > I have run across an interesting MSIE & CSS1 issue.  As near as I can tell
 > it's a bug in MSIE, but I would like a few more opinions before sending it
 > to MS:
 > 
 > .Normal { text-align: left; font-family: "Times New Roman"; font-size:
 > 12pt; }

 > <P CLASS="Normal">
 > <FONT SIZE="5" FACE="Times New Roman">
 > This text should be fairly large.
 > </FONT>
 > </P>

 > The text in the above example ends up in 12pt TNR.  Shouldn't the <FONT>
 > tag override the values set by the CLASS attribute.

CSS is orthogonal to HTML and does not specify how presentational
markup in HTML should influence the presentation. The specification
does say -- however -- that the browser may take presentational markup
into account when rendering:

"The UA may choose to honor other stylistic attributes, for example
'ALIGN'. Such an attribute should be translated to a corresponding CSS
rule with specificity equal to 1. The rule is assumed to be at the
start of the author style sheet and may be overridden by subsequent
rules."

[1] http://www.w3.org/pub/WWW/TR/WD-css1#cascading-order

One way of translating your example into CSS rules would be:

  <P CLASS="Normal">
  <FONT STYLE="font-size: large; font-family: 'Times New Roman'">
  This text should be fairly large.
  </FONT>
  </P>

This translation requires knowledge of how to map SIZE and FACE into
'font-size' and 'font-family'. The numerical value allowed on SIZE map
well into the keyword values allowed on 'font-size' (xx-small |
x-small | small | medium | large | x-large | xx-large).

If the browser chooses this translation, your text will appear 'large'
(which will be larger than 12pt in most rendering environments).

(Note: the above conclusion assumes that there is no other CSS rule that
applies to the FONT element. E.g., if this rule is found in the
STYLE element:
 
  FONT { font-size: 10pt }

.. it will override the rule in the STYLE attribute. This is to allow
the author's style sheets to override presentational markup)

The browser may also choose to ignore the FONT element (perhaps the
DTD it is using doesn't know about FONT), or ignore the SIZE
attribute. In these cases, you will end up with 12pt text.

Regards,

-h&kon

H   å   k   o   n      W   i   u   m       L   i   e
howcome@w3.org   W o r l d   Wide  W e b  Consortium
inria §°þ#¡ª FRANCE http://www.w3.org/people/howcome

Received on Saturday, 2 November 1996 13:51:57 UTC