内容元素的HTML 5验证错误

时间:2014-10-13 21:21:49

标签: html validation

出于某种原因,我在尝试验证代码时遇到以下错误

第36行,第10列:在此上下文中,元素内容不允许作为元素文章的子元素。 (抑制此子树中的更多错误。)

任何人都可以帮忙,这可以纠正吗?

<!DOCTYPE html>
    <html lang="en">
        <head>
            <meta charset="utf-8">
            <title>Pete Webpage</title>
            <meta name="viewport" content="width=device-width; initial-scale=1.0">
            <link rel="stylesheet" href="style.css">    
        </head>

    <body class ="body"> <!-- body start -->

        <header class="mainheader">
         <img src="pic_mountain.jpg" alt="Mountain View" style="width:304px;height:228px">
        <nav><ul>
            <li> <a href="url">link text</a> </li>
            <li> <a href="url">link text</a> </li>
            <li> <a href="url">link text</a> </li>  
            <li> <a href="url">link text</a> </li>  
        </ul></nav>
        </header>

        <div class="mainContent">
        <div class="content">


        <article class="topcontent">
        <header>
        <h2><a href="#" title="First post">First Post</a></h2>  
        </header>

        <footer>
        <p> Pete Webpage</p>
        </footer>

        <content>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec faucibus, velit vitae pharetra commodo, erat dui commodo lectus, id fringilla lectus odio et lorem. Curabitur eget tincidunt sapien. Curabitur elementum dolor </p>
        </content>
        </article>
        </div>
        </div>


        <aside class="top-sidebar">
        <article>
        <h2>Top Side bar</h2>
        <p> lacus. Vestibulum nec placerat mauris. Nunc aliquet nisl a gravida egestas. Nam eu ultricies ex. Suspendisse</p>
        </article>  
        </aside>


        <aside class="bottom-sidebar">
        <article>
        <h2>Bottom Side bar</h2>
        <p> lacus. Vestibulum nec placerat mauris. Nunc aliquet nisl a gravida egestas. Nam eu ultricies ex. Suspendisse</p>
        </article>  
        </aside>

        <footer class="mainFooter">
        <p>Copyright this is the footer</p>
        </footer>

        </body>
        </html>
非常感谢, 皮特

1 个答案:

答案 0 :(得分:0)

{05}提出了<content>元素,但then rejected before it ever got into standards

因此,验证者在评估其任何内容时是正确的,因为它不知道那里可能或应该是什么。

您可能对<main> element which did get standardized感到困惑。