On Fri, Apr 3, 2009 at 5:19 PM, Håkon Wium Lie <howcome(a)opera.com> wrote:
The gain is that the code is easier to reuse. When
style is set
through a class name, it can be overridden by another style sheet. For
example, when creating these samples:
http://www.princexml.com/samples/#wiki
I wrote a style sheet that used the class names and attached new
styles to them. Given a class name like "w180" I could write a new
rule, e.g.:
.w180 { width: 90px }
Style *attributes* -- on the other hand -- are much harder to deal
with. They always win in competition with other conflicting rules.
Except by using !important, which is of course the point of !important.
Many of them are screen-centric so one is forced to
ignore them for
other media. When the style attribute is ignored, there is no hook to
attach style to.
It seems to me that setting the exact width is a rare exception,
and one that shouldn't stand in the way of reusing content.
I don't know. I guess so. We could special-case the default
permitted widths as classes.