2012-10-22 20:31, Philip TAYLOR wrote:
>> You are effectively using the 'style' attribute as a carrier for
>> application-specific data, not for making presentational suggestions.
[...]
>> But no better option appeared to present
>> itself; "title" was an option, but there was a distinct risk that
>> a browser would present the contents thereof as a tooltip, and no
>> way of overriding that behaviour in CSS of which I was aware.
That is correct. The 'title' attribute has sometimes been used for such
purposes, but it has obvious drawbacks, and CSS indeed has no tools for
switching off or tuning the "tooltip" behavior.
>> There is a better option,
>> especially designed for such purposes: data-* attributes; though
>> formally still just part of the HTML5 draft, they can be freely used, as
>> they require no special support in browsers.
>
> If they were in the HTML 4.01 specification (even the transitional
> version), I would use them without compunction.
I see your point, but on the practical side, HTML 4.01 is partly
outdated, and using some HTML5 features - which are in this case just
canonicalization of what actually works in browsers - looks more robust
to me than using 'style' for purposes like this.
> Unfortunately the contraints placed on syntactically valid values
> for the "class" attribute would prevent me from presenting the
> data in a semantically transparent manner : I /want/ to express
> the concept 'Set: 1; parts: 2'
I don't think the constraints prevent that; class="Set: 1; parts: 2" is
valid HTML 4.01, though it somewhat unintuitively specifies four
separate classes. Using such class names in CSS would be problematic
(not impossible - you just need to use some escapes), but in scripting,
you won't have those problems.
Yucca
______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/