- From: David Perrell <davidp@earthlink.net>
- Date: Tue, 4 Aug 1998 14:35:58 -0700
- To: <www-style@w3.org>
Sue Jordan wrote: >> 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? No, "color: gray" is the rule. FONT is the element to which the rule applies. >The attribute values conflict, unless blue=red. There is no conflict. FONT is a child of BODY, and FONT's declared color will take precedence over that inherited from BODY. >IMO, the first declaration you show would be ignored; I've never seen >anything like that style declaration. How about: > > BODY { color: gray } > BODY { color: blue } Ah, the infamous doppelganger interpretation. But the element with color property of gray is eff oh en tee. Why should moving its style declaration to the beginning of the stylesheet respell it bee oh dee why? >If the poster wants to insure that any CSS aware browser renders the >font element in blue, then he could always declare: > >P.specialcaseofblue {color: blue; background: transparent;} > >and use it when he needs it. Well, he or she certainly could do that. But even though, strictly, an inline element like FONT should not be a child of BODY, the above declaration has no bearing on the original example. And even if we assume that the FONT element is contained in the special class of P element, its content will still be gray unless the UA ignores HTML attributes inside styled elements, as IE does. Since Navigator doesn't ignore these attributes, another solution is required. >> For some reason a lot of people have a hard time seeing FONT as just another >> inline element, subject to the same style rules. > >For some reason, words contained in style rules are subject to different >interpretations by different people. That's why we discuss them here, >right? No argument. But before style rules can be interpreted they must be distinguished from the elements to which they are applied. If you look at the FONT element as defined in the loose HTML 4.0 DTD*, you'll see that it is an inline element with three HTML attributes: color, size, and face. These attributes correspond to CSS properties color, font-size, and font-family. The attributes apply to the content of the FONT element, not the BODY element. David Perrell * <http://www.w3.org/TR/REC-html40/sgml/loosedtd.html#basefont>
Received on Tuesday, 4 August 1998 17:35:48 UTC