简体   繁体   English

“看到开始标记头但是同一类型的元素已经打开”

[英]“Start tag head seen but an element of the same type was already open”

When I try my website on the W3C Validator, I have this error: 当我在W3C Validator上尝试我的网站时,我有这个错误:

Start tag head seen but an element of the same type was already open. 看到开始标记头但是已经打开了相同类型的元素。

I tried many things like: re-encode in UTF-8 without BOM, change the syntax, put in and out differents meta but it doesnt resolve my problem. 我尝试过很多东西:在没有BOM的情况下重新编码UTF-8,更改语法,输入和输出不同的元数据,但它不能解决我的问题。

Here is my code: 这是我的代码:

<?php if($_SERVER['REQUEST_URI'] == '/index.php') header('Location:/')?>


<!DOCTYPE html>
<html lang="fr">   
<!-- Begin Cookie Consent plugin -->
<script type="text/javascript">
    window.cookieconsent_options = {"message":"En poursuivant votre navigation sur ce site, vous acceptez l’utilisation de cookies pour réaliser des statistiques de visites","dismiss":"Accepter","learnMore":"Plus d'infos","link":"http://must-assurances.com/mentions-legales.php","theme":"light-bottom"};
</script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/1.0.9/cookieconsent.min.js"></script>
<head>
    <meta charset="UTF-8">
    <title>MUST Assurances</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <meta name="description" content="Site internet de la SAS MUST"/>
    <meta name="keywords" content="assurance, nautique, courtier"/>
    <meta name="author" content="MUST Assurances"/>
    <link rel="apple-touch-icon" sizes="57x57" href="img/favicon/apple-touch-icon-57x57.png">
    <link rel="apple-touch-icon" sizes="60x60" href="img/favicon/apple-touch-icon-60x60.png">
    <link rel="apple-touch-icon" sizes="72x72" href="img/favicon/apple-touch-icon-72x72.png">
    <link rel="apple-touch-icon" sizes="76x76" href="img/favicon/apple-touch-icon-76x76.png">
    <link rel="apple-touch-icon" sizes="114x114" href="img/favicon/apple-touch-icon-114x114.png">
    <link rel="apple-touch-icon" sizes="120x120" href="img/favicon/apple-touch-icon-120x120.png">
    <link rel="apple-touch-icon" sizes="144x144" href="img/favicon/apple-touch-icon-144x144.png">
    <link rel="apple-touch-icon" sizes="152x152" href="img/favicon/apple-touch-icon-152x152.png">
    <link rel="apple-touch-icon" sizes="180x180" href="img/favicon/apple-touch-icon-180x180.png">
    <link rel="icon" type="image/png" href="img/favicon/favicon-32x32.png" sizes="32x32">
    <link rel="icon" type="image/png" href="img/favicon/android-chrome-192x192.png" sizes="192x192">
    <link rel="icon" type="image/png" href="img/favicon/favicon-96x96.png" sizes="96x96">
    <link rel="icon" type="image/png" href="img/favicon/favicon-16x16.png" sizes="16x16">
    <link rel="manifest" href="img/favicon/manifest.json">
    <link rel="shortcut icon" href="img/favicon/favicon.ico">
    <meta name="msapplication-TileImage" content="img/favicon/mstile-144x144.png">
    <meta name="msapplication-config" content="img/favicon/browserconfig.xml">
    <link rel="stylesheet" href="css/landio.css">
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="css/animate.css">
    <link rel='stylesheet' type='text/css' href='https://fonts.googleapis.com/css?family=Merriweather:400,300,300italic,400italic,700,700italic,900,900italic%7CLato:400,100,100italic,300italic,400italic,300,700italic,900,900italic,700'>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
</head>


  <body class="animated fadeIn"></body>

Do you have any ideas? 你有什么想法?

The start tag for the <head> element is optional. <head>元素的开始标记是可选的。 A <script> element cannot be a child element of the <html> element. <script>元素不能是<html>元素的子元素。

Consequently, <script type="text/javascript"> implies the start of the <head> element so when you explicitly type <head> you are trying to open a <head> instead another <head> which is not allowed. 因此, <script type="text/javascript">意味着<head>元素的开始,因此当您明确键入<head>您尝试打开<head>而不是另一个<head> ,这是不允许的。

Either: 或者:

  • Move <head> to before the <script type="text/javascript"> or <head>移动到<script type="text/javascript"> 或之前
  • Remove the explicit <head> start tag entirely. 完全删除显式<head>开始标记。

script标签应该在head或body标签内

暂无
暂无

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

相关问题 看到开始标记头但是已经打开了相同类型的元素 - Start tag head seen but an element of the same type was already open W3C HTML5 错误开始标签头看到但相同类型的元素已经打开 - W3C HTML5 ERROR Start tag head seen but an element of the same type was already open 看到一个开始标记,但是相同类型的元素已经打开 - An a start tag 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 已看到开始标记主体,但已打开相同类型的元素 - Start tag body seen but an element of the same type was already open 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” 如何在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.” “看到了开始标签主体,但相同类型的元素已经打开”并且无法弄清楚如何水平居中? - "Start tag body seen but an element of the same type was already open" & can't figure out how to center horizontally? HTML5 验证错误:看到正文开始标记,但已打开相同类型的元素 - HTML5 Validation Error: body start tag seen but an element of the same type was already open
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM