Re: CSS and presentational markup
On Jun 5, 6:50pm, Todd Fahrner wrote:
> In documents with both CSS and presentational markup (e.g., <font>
> and <center> "elements", <B>, <I>, and align and color attributes ) I
> have noticed that sometimes CSS can override the usual rendering of
> the markup, and other times it can't.
For details on how a mix of CSS and presentational cruft^H^H^H^H^Hmarkup
should be handled, see
" The UA may choose to honor other stylistic HTML attributes, for
example 'ALIGN'. If so, 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. In a transition phase,
this policy will make it easier for stylistic attributes to coexist
with style sheets. "
So whether you can over-ride a particular piece of markup depends on
> More troubling, IE4b1 and NS4b5 each have unique sets of
> presentational elements/attributes that CSS can override. NS4, for
> example, will ignore <font size=+1> on an element if CSS specifies a
> fixed size, while IE4 will honor the markup.
Fine, notice the "may choose to"
> There's no apparent
> rhyme or reason. I haven't done an exhaustive survey, but it appears
> that NS4b5 will override presentational markup more often than IE4b1
> I think CSS should always be able to override all presentational
> markup and attributes,
It can, by including rules of greater specificity.
> including positioning achieved by means of
perhaps you could give an example here. I know what you mean by
"positioning achieved by means of tables" but I don't see how one could
easily get rid of the effect of the table such that the presentation
is as clean as if the table was not there.
> This will encourage designers to style with CSS "top down",
> then consider whether or not to prettify documents for non-CSS
> browsers. If CSS cannot override presentational markup, designers
> will begin with markup, and turn to CSS only for "extra" effects.
> This will retard adoption of CSS by minimizing reliance on it.
This seems a sound argument, about encouraging top-down design (and
encouraging cascadable design, which seems related).
Chris Lilley, W3C [ http://www.w3.org/ ]
Graphics and Fonts Guy The World Wide Web Consortium
http://www.w3.org/people/chris/ INRIA, Projet W3C
email@example.com 2004 Rt des Lucioles / BP 93
+33 (0)4 93 65 79 87 06902 Sophia Antipolis Cedex, France