【问题标题】:XHTML ValidationXHTML 验证
【发布时间】:2015-09-01 21:50:31
【问题描述】:

我正在通过 W3C 验证运行我的 XHTML 文件,但出现了一个错误。但是,我无法理解错误 - 它显示“范围内没有 p 元素,但看到了 p 结束标签”。

有眼光的人能看出来吗?

这是我的代码:

 <div id="mainBody">
             <div id="text">
                 <p>
                     <img src="images/billyGraham.png" alt="Billy Graham">
                     <blockquote>
                     Billy Graham:<br><br>
                     Is it not arrogance or narrow-mindedness to claim that there is only one way of salvation or that the way we follow is the right way? I think not. After all, do we fault a pilot for being narrow-minded when he follows the instrument panel [while] landing in a rainstorm? No, we want him to remain narrowly focused!
                     </blockquote>
                 </p>   
             </div>
        </div>

【问题讨论】:

    标签: html xhtml


    【解决方案1】:

    blockquote 元素不能在 P 元素内。这是无效的 HTML。虽然如果您已经在目标浏览器中进行了测试并且没有问题我不会太担心,但验证只是一个指导方针,不应该过于字面意思(IMO)

    【讨论】:

    • 感谢您的回复。
    猜你喜欢
    • 2011-03-18
    • 1970-01-01
    • 2012-04-27
    • 2013-06-11
    • 2014-07-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多