为什么此代码在W3C验证器中显示错误?

时间:2010-06-10 16:15:26

标签: xhtml w3c-validation

为什么此代码在W3C验证器中显示错误“此处不允许使用”字符数据“

<blockquote>all visible objects, man, are but as pasteboard masks. 
        But in each event -- in the living act, the undoubted 
        deed -- there, some unknown but still reasoning thing 
        puts forth the mouldings of its feature from behind 
        the unreasoning mask. If man will strike, strike 
        through the mask. All visible objects, man, are but as pasteboard masks. 
        But in each event -- in the living act, the undoubted 
        deed -- there, some unknown but still reasoning thing 
        puts forth the mouldings of its feature from behind 
        the unreasoning mask. If man will strike, strike 
        through the mask.</blockquote>

此验证程序http://www.onlinewebcheck.com/

中没有任何错误

3 个答案:

答案 0 :(得分:3)

您不能将文字放在<blockquote>标记内。您必须将其包装在另一个元素中,例如<p>标记:

<blockquote>
  <p>My text.</p>
</blockquote>

答案 1 :(得分:1)

blockquote不应该直接包含文本。在验证之前,您需要将文本包装在单个p标记或一系列p标记中。

答案 2 :(得分:0)

  

注意:要将blockquote元素验证为严格的HTML / XHTML,该元素必须只包含其他块级元素,如下所示:

     

&LT; BLOCKQUOTE&GT;   &lt; p&gt;这里有一个长引号,是一个长引号&lt; / p&gt;   &LT; / BLOCKQUOTE&GT;

来源:w3schools.com