简体   繁体   English

W3C HTML验证错误:“流浪结束标记 </head> ”和“开始标签 <body> 看到了,但是相同类型的元素已经打开了”

[英]W3C HTML validation errors: “Stray end tag </head>” and “Start tag <body> seen but an element of the same type was already open”

This part of the code, when validated by W3C validator, gives 2 errors: 经过W3C验证程序验证后,这部分代码会产生2个错误:

  1. Stray end tag </head> 流浪结束标签</head>

  2. Start tag <body> seen but an element of the same type was already open 起始标签<body>可见,但是相同类型的元素已经打开

<!DOCTYPE html>
<html lang="en"> 
    <head>
        <title> Chatter </title>
        <h1> Welcome to Chatter|app! </h1> 

        <style>
            body {
               background-color: #e0e0e0;}
        </style>

    </head>

    <body>

        <h4> #Food </h4>
        <h4> #Movies </h4>
        <h4> #SpaceX </h4>
        <h4> #Thingstodo </h4>
        <h4> #Chatter </h4>


        <input type= "button" value= "New" />
        <input type= "button" value= "Trending" />
        <input type= "button" value= "Favorites" />
    </body>
</html>

Just move the h1 element from head seaction to body section 只需将h1元素从头部连接移动到身体部分

<!DOCTYPE html>
<html lang="en">
<head>
    <title> Chatter </title>

    <style>
        body {
            background-color: #e0e0e0;
        }
    </style>

</head>
<body>
    <h1> Welcome to Chatter|app! </h1>

    <h4> #Food </h4>
    <h4> #Movies </h4>
    <h4> #SpaceX </h4>
    <h4> #Thingstodo </h4>
    <h4> #Chatter </h4>

    <input type="button" value="New" />
    <input type="button" value="Trending" />
    <input type="button" value="Favorites" />
</body>

</html>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 W3C HTML5 错误开始标签头看到但相同类型的元素已经打开 - W3C HTML5 ERROR Start tag head seen but an element of the same type was already open 如何在HTML中修复“Stray end tag head。”和“Start tag body body,但是已经打开了相同类型的元素。” - How to fix “Stray end tag head.” and “Start tag body seen but an element of the same type was already open.” in HTML W3C验证程序:“看到一个开始标记,但是相同类型的元素已经打开。” - W3C validator: “Start tag a seen but an element of the same type was already open.” HTML验证列19:看到一个正文开始标签,但是相同类型的元素已经打开 - Html Validation Column 19: An body start tag seen but an element of the same type was already open HTML5 验证错误:看到正文开始标记,但已打开相同类型的元素 - HTML5 Validation Error: body start tag seen but an element of the same type was already open 杂散开始标签td &amp;&amp;杂散结束标签td。 w3c验证 - Stray start tag td && Stray end tag td. w3c validation “看到开始标记头但是同一类型的元素已经打开” - “Start tag head seen but an element of the same type was already open” 看到开始标记头但是已经打开了相同类型的元素 - Start tag head seen but an element of the same type was already open 已看到开始标记主体,但已打开相同类型的元素 - Start tag body seen but an element of the same type was already open HTML:错误:开始标记已看到但相同类型的元素已打开 - HTML: Error: Start tag a seen but an element of the same type was already open
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM