W3C home > Mailing lists > Public > www-style@w3.org > September 1998

RE: FONT vs CSS

From: Braden N. McDaniel <braden@shadow.net>
Date: Tue, 8 Sep 1998 22:21:52 -0400
To: "Smith, Brooke" <Brooke.Smith@Butterworths.com.au>, "'Chris Wilson'" <cwilso@MICROSOFT.com>, "'www-style'" <www-style@w3.org>
Message-ID: <002901bddb98$9b4abb80$00808080@bonezero>
> -----Original Message-----
> From: www-style-request@w3.org [mailto:www-style-request@w3.org]On
> Behalf Of Smith, Brooke
> Sent: Tuesday, September 08, 1998 8:56 PM
> To: 'Chris Wilson'; 'www-style'
> Subject: FONT vs CSS
>
>
> Greetings,
>
> Chris Wilson and myself exchanged a few emails on the www-style list (a
> while ago) regarding Font vs CSS.  It appears that FONT information (and
> other presentational elements) will interact with CSS and can even have a
> greater weight, such as in this example:
>
> <STYLE>
> P {color:blue}
> EM {color:green}
> </STYLE>
> ...
> <P>This is a paragraph <EM><FONT color="red">with emphasised
> text</FONT></EM>.</P>
> ...
>
> In this example the FONT has greater weight and so 'wins'.

Right. Consider what should happen if you replaced your FONT element with a
SPAN element with the corresponding value for the STYLE attribute.

>  Swap
> the EM and
> FONT and the EM will have the greater weight. (This is under IE4
> on Win95 -
> there was a 'bug' in IE3 such that the CSS would always win).  But what
> about "! important".  Wouldn't having that on the EM style decl for colour
> override FONT?  It doesn't.

No, !important shouldn't have any effect; it deals with the cascade, and
it's inheritance that gives rise to the behavior you observe.

> I think it is rather silly that FONT et al would have any play in
> CSS styled
> HTML on a CSS browser

CSS-aware browsers are not obligated to pay any heed to stylistic attributes
in the HTML. But if they do, the CSS specs describe the rules that should be
followed.

 but then I guess it is impossible to turn
> off FONT et
> al rendering as you don't really know what the author intended.
> HOWEVER, I
> thought
>
> FONT {text-decoration:none}
>
> could be used to prevent FONT having any play at all.

I don't see why it should; that property says nothing about the color or
font family, both of which FONT can set. Text decoration speaks to
underlining, overlining, and strikethrough--none of which FONT can affect.
The style definition you've given just guarantees that FONT elements will
not be underlined, overlined, or stricken (barring any overriding rules, of
course). (Oh, yeah... text-decoration also controls blinking... how could I
forget.)

>  But this doesn't
> work.  NONE doesn't switch off font rendering (but 'underline' will
> underline the font text).  So what is the purpose of 'NONE'?  I
> checked the
> mastergrid of which browser on which platform supports what
> (http://www.webreview.com/guides/style/mastergrid.html) and NONE is indeed
> supported on Windows IE4.  Looking at an article by Eric Meyer
> (http://webreview.com/wr/pub/98/07/10/style/index.html) it says the 'NONE'
> is the default.

"none" is the initial value. This could be considered a default in a certain
context, but keep in mind that your UA's style sheet could modify this value
to a different "default." For example, it is likely that UAs that support
the U element will give it the property definition "text-decoration:
underline" by default.

>  Thus text-decoration just does modification
> (relative) and
> is not for absolute values (where NONE would mean 'turn everything off').
> Perhaps then, what I really want is a way to decrease the weight - a '!
> NOTimportant'.  Is there a means to do this?

Not really.

As far as I can tell, IE4 is working as the CSS1 spec says it should in this
regard. I see your point, though, that this complicates authoring pages that
will include similar stylistic information for both CSS and non-CSS
browsers. Here is a workaround, though it may prove tedious if you have a
lot of FONT elements: give each of your font elements an ID, and use ID
selectors in a style sheet to turn off whatever it is you're doing in the
FONT element's attributes. For example:

<STYLE TYPE="text/css">
#foo {
	font-family: inherit;
	color: inherit;
}
</STYLE>
...
<FONT ID="foo" FACE="Butt Ugly Medium" COLOR="lime">Silence is FOO!</FONT>

I believe doing the same in the STYLE attribute should have the same effect.
The catch is, this requires the availability of the "inherit" value, which
is a CSS2 thing and thus probably not in any browsers (maybe IE5? Haven't
checked).

Braden

<http://www.endoframe.com>
Received on Tuesday, 8 September 1998 22:23:22 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:53:56 GMT