首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么这段代码在W3C验证器中显示错误?

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

Stack Overflow用户
提问于 2010-06-10 16:15:26
回答 3查看 856关注 0票数 1

为什么在W3C验证器中显示错误的代码“字符数据在这里不允许”

代码语言:javascript
复制
<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/中出现任何错误。

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2010-06-10 16:16:50

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

票数 1
EN

Stack Overflow用户

发布于 2010-06-10 16:17:32

您不能将文本放入<blockquote>标记中。您必须将它包装在另一个元素中,如<p>标记:

代码语言:javascript
复制
<blockquote>
  <p>My text.</p>
</blockquote>
票数 3
EN

Stack Overflow用户

发布于 2010-06-10 16:20:45

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

来源:w3schools.com

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/3016260

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档