Recently, Anne van Kesteren demonstrated
nice technique with the XHTML
media attribute designed to deliver a contact form to screen users, while giving
a postal address for print users. Faruk Ates also published an interesting article
2.0 and Google, specifically focussing on the potential abuse of
media attribute to hide content from screen users, but not from Google.
However, this got me thinking about some of the accessibility issues involved
with this technique.
Take a look at Anne’s example:
<section> <h>Contact</h> <div media="screen"> Contact form to be inserted here. </div> <div media="print"> <address layout="relevant">Anne van Kesteren Crosestijn 4629 …</address> </div> </section>
As you can see, this clearly provides suitable alternate content for users
depending on whether they’re using a
screen medium, or
tv or any other media? They get nothing!
Clearly, the intention of this example is that the contact form is not suitable
for any static media (
all media. One solution,
and currently the only usable solution, is to explicitly list all suitable media
in the attribute (it’s a comma separated list). However, what happens when CSS
extends the list of possible media in the future? Would the media attributes
then need to be updated to reflect this?
Another solution I can think of would be to allow for the CSS media groups to be used instead, but AFAICT, that’s not possible at this stage. For example, the above example could become:
<section> <h>Contact</h> <div media="interactive"> Contact form to be inserted here. </div> <div media="all"> <address layout="relevant">Anne van Kesteren Crosestijn 4629 …</address> </div> </section>