[Skip navigation] home | about MCU | Services | learn accessible web design | tips archive

contact   
RSS syndication for MCU   

How to get your XHTML pages to validate when using blockquote.

This is a tip for those on the bleeding edge of web page markup, i.e. those marking up their web pages using XHTML strict. If you are the sort of person using XHTML it is likely that you will want to ensure your pages validate when tested with the World Wide Web Consortiums markup validator.

Would it surprise you if I said the following code doesn't validate,

<blockquote cite="http//mywebsite.com">
Blah, blah, blah and so on..
</blockquote>

It looks simple enough - what could be wrong with that? I came across this very problem - and spent a half hour trying to figure out why it didn't validate. I investigated various options - including thinking that I must have some strange, invisible and illegal characters in my quote somewhere. After scratching my head for a while I looked at the specifications for XHTML and found the answer.

To validate as strict XHTML, you must add a block-level element around the text within the <blockquote> tag, like this:

<blockquote cite="http//mywebsite.com">
<p>Blah, blah, blah and so on..</p>
</blockquote>

Problem solved - now my page validates - and so will yours the next time you use the blockquote tag in your XHTML documents.

Contributed by Jim Byrne
Updated Friday 25 Jun 2004


Free weekly accessible web design tip

Register for your weekly accessible web design tip 
Email: