1

为什么此代码在 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/中没有给出任何错误

4

3 回答 3

3

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

<blockquote>
  <p>My text.</p>
</blockquote>
于 2010-06-10T16:17:32.757 回答
1

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

于 2010-06-10T16:16:50.357 回答
0

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

<blockquote> <p>这里是长引用这里是长引用</p> </blockquote>

资料来源:w3schools.com

于 2010-06-10T16:20:45.823 回答