繁体   English   中英

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

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

当我在W3C Validator上尝试我的网站时,我有这个错误:

看到开始标记头但是已经打开了相同类型的元素。

我尝试过很多东西:在没有BOM的情况下重新编码UTF-8,更改语法,输入和输出不同的元数据,但它不能解决我的问题。

这是我的代码:

<?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>

你有什么想法?

<head>元素的开始标记是可选的。 <script>元素不能是<html>元素的子元素。

因此, <script type="text/javascript">意味着<head>元素的开始,因此当您明确键入<head>您尝试打开<head>而不是另一个<head> ,这是不允许的。

或者:

  • <head>移动到<script type="text/javascript"> 或之前
  • 完全删除显式<head>开始标记。

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

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM