WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Interesting effect with CSS

for

From: Leif Halvard Silli
Date: Jan 8, 2012 6:06AM


Patrick H. Lauke, Sun, 08 Jan 2012 12:41:15 +0000:
> On 08/01/2012 11:43, Leif Halvard Silli wrote:
>> There is an alternative to using
>> li:before{content:'txt'}
>> and that is to use the ::marker pseudo element:
>> li::marker{content:'txt'}
>>
>> The only parser I know with support for ::marker, is Prince XML. But at
>> any rate, I suppose that when support is there, the UA and screenreader
>> would know that the marker should not be read.
>
> ...but in the meantime that content will be available to nobody? (unless
> they're using Prince XML)

True. But I was justing trying to point out that the problem is not
really that the CSS content:; property causes things to be read by
screen readers. Rather the problem is that the content attribute, in
this case, was applied to the wrong feature.

>> Another way to solve this problem would be to use media queries and
>> then to not send the 'content CSS' to the screenreaders. But so far,
>> screenreaders have not implemented media queries, so we are out of
>> luck.
>
> I don't think there's any media type of media query property that can be
> used specifically to target "screenreaders", and I doubt there will be
> in the near future.

Agree. But the trend towards rendering generated content in screen
readers, makes it more reasonable that screen readers *would* support
such a thing. Quite a few things could have been solved that way. In
fact, the trick to use generated CSS to hide things from screen
readers, is just a variant of the normal screen reader hacks: Do
something 'weird' that screen readers either don't understand or
something which only they would render.

> Heck, there's no way to specifically target "handheld" or "tv" - even
> though media *types* for those actually do exist - they are simply
> ignored by all user agents on those particular devices because,
> historically, they have been used to send "lower quality / lowest common
> denominator" type styles to old devices (exceptions here: Opera Mini
> reacts to "handheld", but only if users have enabled the "single column
> view" option,

I almost always do use it in that mode ...

> and the only major device that obeys "tv" is, to my
> knowledge, the first generation Nintendo Wii internet channel, i.e.
> Opera 9. (full disclosure: I work for Opera, but I'm not saying these
> for promotional purposes, but because I believe they're technically
> accurate).

It is at least possible to limit certain styles to @media screen, in
order to enhance content for the 'screen' media - whoever that consider
themselves as such. Also @media print is known to work quite OK. That
there are some failures, is not a reason for screen readers to not
implement @media screenreader [yes, there is a proposal for such a
media].
--
Leif H Silli