- From: Martin Atkins <mart@degeneration.co.uk>
- Date: Mon, 16 Jul 2007 19:30:47 +0100
- Cc: www-style@w3.org
Dmitry Turin wrote:
> Good day, Martin.
>
>>> p[color="red"] {...}
>>> table {cellspacing:0}
>>>
>>> <span color="red" class="a">
>
> MA> all presentational attributes in HTML should have equivilant properties in CSS ...
> +1
>
> MA> ... exact name, content model and usage may differ.
> -1
> I thought exactly about this, when i created topic.
>
> MA> HTML doesn't have a "color" attribute on SPAN.
>
> -1 for me.
> I messed two ideas in one letter without comments:
> idea of unification "in vertical"
> (unification of attribute's and property's names, content model and usage),
> and idea of unification "in horizontal"
> (unification by extending of presentational features to all tags -
> as far, as it's possible).
>
So as far as I can tell, you are proposing that:
* All CSS properties be allowed as HTML attributes, and
* All HTML attributes be allowed as CSS properties
This is troublesome for a number of reasons:
* There are some situations where HTML attributes and CSS properties
overlap with different parsing rules or semantics. For example, <TABLE
BACKGROUND="#ffffff"> is not correct: the BACKGROUND attribute expects a
URI, not a colour. CSS, on the other hand, considers "background" to be
a shorthand for a number of other properties, including background-image.
* As hinted on in the previous point, there is a massive overlap
between CSS properties and HTML attributes. In order to mix the two,
you'd have to define what happens when a UA encounters (for example)
<table bgcolor="red" background-color="blue">, or you'd have to throw
away either most of HTML or most of CSS.
* CSS is fundamentally about presentation, so there are plenty of HTML
attributes that really have no place in CSS. For example:
a#home { href: "/index.html"; }
* In HTML, attribute value types are generally determined by
convention or specification, while CSS determines these by syntax. See
my above example where the HTML HREF attribute expects a string
containing a URI while CSS would normally use url("/index.html").
I think really your main qualm is that the style="" attribute syntax is
quite verbose and that it embeds one language inside another, which I
can agree with to some extent. However, for the reasons enumerated
above, plus the popular recommendation that style information be
ommitted from the HTML document completely, I don't think that HTML can
feasibly be altered the way you describe.
Received on Tuesday, 17 July 2007 07:00:29 UTC