The following code segment for an FAQ, which uses XHTML 1.0, will not validate successfully in the W3C validator.
I’m inserting the Q&A into a definition list in order to maintain the question & answer relationship semantically. The problem is, the questions can be multiple paragraphs. And the <dt>
tag, at least in XHTML 1.0, only allows for inline elements. So I can’t put a <p>
tag in there without throwing an error in the W3C validator.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<dl>
<dt>
<p>This is a very long question.</p>
<p>It has multiple paragraphs.</p>
</dt>
<dd>
<p>This is the answer</p>
</dd>
</dl>
</body>
</html>
Is there a semantically better way of coding this using XHMTL 1.0 Transitional?
For reference, the latest similar thread I can find on the topic is this is What is the best way to semanticly structure a FAQ?. The thread was useful, however it does not cover multiple paragraphs in the question.