Skip to main content

Jim Byrne Accessible Website Design Glasgow for The Third Sector, Voluntary, Charities and Not for Profits

Accessible, Responsive Website Design
Jim Byrne Web Designer

How to get your XHTML pages to validate when using the blockquote element

This is a tip for those marking up their web pages by hand 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 quoted text 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 the markup validates – and so will yours the next time you use blockquote in your XHTML documents.

Take my Web Accessibility Online Training Course - WCAG 2.1 Compliance

Learn to design and manage WCAG compliant, accessible websites with my online course

You will learn both the techniques of accessible website design and an entire ‘framework for thinking about the subject’. It will equip you with the skills to understand, identify and fix issues any accessibility issues you come across. Watch the free videos to get a taste of what is on the course. Video image from Web Accessibility Online Training Course - WCAG 2.1 Compliance

Related content

Related content

View a list of all blog posts.

Written by :

Avatar of JamesByrne

Let's Chat

07810 098 119

“The audit was extremely comprehensive, clear and demonstrated Jim’s expertise in the area of accessible web design.” Peter Madden, Project Manager, Sealed Envelope Ltd