Re: [css3-content] [css21-content] Syntax for adding alternative text for inserted image

On Fri, Nov 19, 2010 at 10:22 AM, Belov, Charles
<Charles.Belov@sfmta.com> wrote:
> Boris Zbarsky [mailto:bzbarsky@MIT.EDU] wrote on Friday, November 19,
> 2010 5:25 AM
>> On 11/19/10 3:41 AM, Belov, Charles wrote:
>> > http://www.w3.org/TR/css3-content/#inserting3
>> > and
>> > http://www.w3.org/TR/CSS2/generate.html#content
>> > would be improved by an example as to how to add an alt
>> attribute with
>> > a text value, for example "New!" onto the image brought in
>> by the uri.
>>
>> Uh...  If you need to add alt text, then the image has
>> semantic meaning; it's not just a decoration.
>>
>> If it has semantic meaning, then adding it via CSS is just
>> wrong. In particular, it'll break badly in a UA that just
>> doesn't load your CSS.
>>
>> So there is no way to the alt text, because if you need to do
>> it, you're misusing the feature badly.
>
> I'm puzzled here.  The syntax also allows for adding strings, which
> could also be semantic (although presumably not causing problems for
> screen readers unless it also was ignored by the user agent).  Are you
> saying that only meaningless strings such as " " or "*#*#*#*" belong in
> a content property?  (A string of "*" of course becomes semantic if used
> to mark required fields or otherwise marks certain items as having a
> certain property.)
>
> Or perhaps we could think of it more like an independent clause, which
> if missing does not change the meaning of a sentence but if present
> enriches understanding of the sentence.

The latter.  If you're using generated content to add necessary
information, you're doing it wrong.  It's just meant for styling
purposes, which sometimes means adding short strings.

So, like Boris said, if you're doing it right, any image you add via
generated content is, *by definition*, decorative and thus doesn't
need alt text.

~TJ

Received on Friday, 19 November 2010 18:37:08 UTC