验证失败,但我无法找到错误的原因

时间:2014-11-01 20:04:05

标签: html html5 validation error-handling

美好的一天,

我在过去几周试图验证我的HTML页面几次,并且每次出现错误都非常烦人,因为我发现元素标签未被关闭的代码部分没有任何问题等等 它告诉我段落中没有开头段落标记。但是我可以自信地说有......

错误(根据W3 Validator):

  

验证输出:1错误

     

错误第18行,第618列:范围内没有p元素,但看到了p结束标记。

…="Not Very Popular Name"><strong><q>Name</q></strong></abbr>
> Name</p**>**

错误位置之前和之后的代码部分:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Living life on the Brink</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" type="text/css" href="css/about-me.css">
</head>
<body>
<header class="about-me">
<hr>
<h1>My Name</h1>
<p>I dont normally like talking about myself, so I'll try and express myself and who I am mostly with images, although I am supposed to use the full range of HTML elements which we have learned in week 1 <br>:)</p>
</header>
<div class="location">
<hr>
<h2>Location, location, location...</h2>
<p>I like to think I have an open outlook to things. Having gone from my <em>birthplace</em> in <blockquote><strong>A place</strong><sub>English</sub></blockquote> to my <em>home</em> in <blockquote><strong>A place</strong> <sup>German</sup></blockquote> through my recent <em>educational paradise</em> in <blockquote><strong>A place</strong><sub>Spanish</sub></blockquote> into <blockquote><strong>A place</strong><sup>English <sup>AGAIN</sup></sup></blockquote> all the way to where I stand right now, Another place... <abbr title="Not Very Popular Name"><strong><q>Name</q></strong></abbr> Name.</p>

那么问题是什么呢?有人可以指出错误,这很可能是一个非常明显的错误,它逃脱了我...是否有可能在段落元素中嵌套了太多元素?它应该不是,但可能是一种可能吗?

谢谢! Saborknight

1 个答案:

答案 0 :(得分:1)

<blockquote>是块级元素,不允许在<p>标记内;)

https://developer.mozilla.org/en/docs/Web/HTML/Block-level_elements