WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Well formed verses Valid code


From: Alastair Campbell
Date: Feb 26, 2007 7:30AM

Phil Teare wrote:
> if you're marking up markup or script (which you'll prob have
> to encode anyway) please stick it in a div and label it code

Surely the author/CMS should put the snippet in a pre and/or code?

I tend to use this for blocks of code:

[code here]

And just a code element for inline bits. Anything in a pre, code, var,
kbd etc. could justifiably have a different rendering, audio or

I guess the hard part is authors who don't encode their content
snippets? In which case uuencoded ampersands would cause issues,
although perhaps not when in an attribute such as href?

> e.g. if any of the code snippet looks like the TTS engine's take
> on SOAP, SAMPA, IPA, or more likely its own proprietory XML based
> command strings (for a section to be read faster, louder, by a
> voice etc...),

Are certain UAs are looking for their own custom XML snippets in the
page? Surely that would encouraging inline, agent-specific styling/code?

Kind regards,


Alastair Campbell | Director of User Experience

Nomensa Email Disclaimer: