W3C home > Mailing lists > Public > www-style@w3.org > November 2014

UNS: [Moderator Action] [css-pseudo] allowed values for CSS alt

From: Michiel Bijl <michiel@agosto.nl>
Date: Wed, 05 Nov 2014 10:01:59 +0000
To: <www-style@w3.org>
Message-ID: <6896461bdc475e265f47a2dd274ba1ea@agosto.nl> (sfid-20141105_100205_179878_B793FA13)
Bruce Lawson brought the new alt attribute for generated content to my 
attention on Twitter[1]. With all these icon fonts that float around the 
web, I think it is a good thing you can specify an alt text. This does 
bring up some concerns, though. As Bruce stated on Twitter[2]:

> Content in CSS *is* yuck. But the foo:before {content: "blah"} ship 
> has sailed.

I do agree that content in CSS is yuck, but can definitely see the 
advantages of generated content. 'content:' within ::before and ::after 
takes a couple of values, one of which is 'attr(<identifier>)' [3]. This 
way you can use the content of an attribute on the element the rule 
applies to. I suggest we add the same value to the 'alt' attribute [4]. 
This could help with translations, but also uphold one of the core 
principles of the web:

> Separation of Concerns
> HTML should allow separation of content and presentation. [5]

—Michiel Bijl

[1]: https://twitter.com/brucel/status/529920245126164480
[2]: https://twitter.com/brucel/status/529926547189534720
[4]: http://dev.w3.org/csswg/css-pseudo/#alt-property
Received on Thursday, 27 November 2014 15:49:05 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:48 UTC