简体   繁体   中英

<head> content is in <body> instead of <head> when I include it as header

When I try to include my header in my page, I get a white bar above my page. When I inspect this page it says all the content of the is standing in the and the is empty. I don't have this on every page, just some, eventhough it's the same header. When I copy the content of this header into the page instead of using an include, I don't have this problem.

This is the code I have in my header:

<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>Flower Power</title>
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=no">
<meta name="description" content="Default Description">
<meta name="keywords" content="fashion, store, E-commerce">
<meta name="robots" content="*">
<link rel="icon" href="../afbeeldingen/favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="../afbeeldingen/favicon.ico" type="image/x-icon">

<!-- CSS Style -->
<link rel="stylesheet" type="text/css" href="../stylesheet/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="../stylesheet/font-awesome.css" media="all">
<link rel="stylesheet" type="text/css" href="../stylesheet/revslider.css" >
<link rel="stylesheet" type="text/css" href="../stylesheet/owl.carousel.css">
<link rel="stylesheet" type="text/css" href="../stylesheet/owl.theme.css">
<link rel="stylesheet" type="text/css" href="../stylesheet/jquery.bxslider.css">
<link rel="stylesheet" type="text/css" href="../stylesheet/jquery.mobile-menu.css">
<link rel="stylesheet" type="text/css" href="../stylesheet/style.css" media="all">
<link rel="stylesheet" type="text/css" href="../stylesheet/responsive.css" media="all">

<link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,700italic,400,600,700,800' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Roboto+Slab:400,700' rel='stylesheet' type='text/css'>
<meta name="viewport" content="initial-scale=1.0, width=device-width">

</head>

The page with this problem is http://ctimmers.gcmediavormgeving.nl/account

The page I include it in starts like this

<?php include 'templates/header.php';?>

  <div class="page-heading">
    <div class="container">
      <div class="row">
        <div class="col-xs-12">
        <div class="page-title">
<h2>Dashboard</h2>
</div>
        </div>
      </div>
</div>

and ends ofcourse with: </body></html>

Ok so I created a file in notepad++ instead of just notepad and it seems that it didn't add the BOM code with those weird character. I copied the code to it and replaced it with the old file. The problem is solved now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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