RE: Style sheet and Netscape

> -----Original Message-----
> From: www-style-request@w3.org [mailto:www-style-request@w3.org]On
> Behalf Of Sue Jordan
> Sent: Tuesday, August 04, 1998 1:42 PM
> To: www-style@w3.org
> Subject: Re: Style sheet and Netscape
>
>
> David Perrell wrote:
> >
> > Sue Jordan wrote:
>
> > ...these attributes are translated to the corresponding CSS
> > >rules with specificity equal to 1. The rules are assumed
> to be at the
> > >start of the author style sheet and may be overridden by subsequent
> > >style sheet rules."
> > >
> ...
> > Overridden by what?
>
> Subsequent style sheet rules, says the cite.

That is accurate--if those rules exist; but in the example given, no such
rules exist.

> > Only the color property for BODY was defined in the
> > stylesheet in the original example. The FONT element was an
> offspring of
> > BODY, and its color declaration would therefore override it.
>
> YM <FONT> will not be translated to the corresponding CSS
> rules with specificity equal to 1?

I don't think that's what he means. The first cascading rule sez:

"If no declarations apply, the inherited value is used. If there is no
inherited value (this is the case for the 'HTML' element and for properties
that do not inherit), the initial value is used."

In this case, there *are* declarations that apply. So the inherited value
would *not* be used.

> > Assuming the
> > FONT color declaration to be at the start of the
> stylesheet, the style
> > declarations become:
> >
> >   FONT { color: gray }
> >   BODY { color: blue }
>
> Oh. So <FONT> _will_ be translated to the corresponding CSS
> rules with specificity equal to 1?
>
> > FONT is not in conflict with the original poster's style
> declaration,
>
> The attribute values conflict, unless blue=red.

What do you mean by "conflict"? Yes, it is accurate that blue != red.
However, the inheritance rules resolve this. As I have stated and given
evidence for (from section 1.3 of the CSS1 spec), inheritance is the default
behavior for color, and will be overridden by a specific value given on an
element which would otherwise inherit.

> > and the above declaration should produce 4.x Navigator's rendering.
>
> IMO, the first declaration you show would be ignored;  I've never seen
> anything like that style declaration.

Oh, no? I find that very surprising. How about

	P { color: red }
	BODY { color: blue }

Are you telling me that P text in the document with this style sheet should
be rendered in blue?

> How about:
>
>     BODY { color: gray }
>     BODY { color: blue }

This is different. Here, we have two rules which have the same weight. So
this is resolved by their order, according to the 5th cascading rule:

"Sort by order specified: if two rules have the same weight, the latter
specified wins. Rules in imported style sheets are considered to be before
any rules in the style sheet itself."

Braden

Received on Tuesday, 4 August 1998 17:15:27 UTC