使用最新版本的 Google Chrome 浏览我的网站并使用 F12 查看源代码时,和之间的所有内容都<head>
显示为</head>
空。在 Firefox 和 IE 的最新版本中,一切都正常显示。
实际上内容被移动到谷歌浏览器的正文中。
这显然不是 CSS 问题。我正在使用 Twitter Bootstrap CSS 和 JS,以及一个 MVC PHP 框架。有人有提示吗?
这是我的 document.html 页面:
<!DOCTYPE html>
<html lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title><?php echo (Template::$titre); ?></title>
<?php foreach(Template::$meta as $key=>$value): ?>
<meta name="<?php echo $key; ?>" content="<?php echo $value; ?>" />
<?php endforeach; ?>
<link rel="shortcut icon" href="<?php echo WEB; ?>assets/style/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="<?php echo WEB; ?>assets/style/bootstrap.min.css" />
<link rel="stylesheet" href="<?php echo WEB; ?>assets/style/bootstrap-responsive.min.css" />
<link rel="stylesheet" href="<?php echo WEB; ?>assets/style/main.css" />
<link href='http://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<?php require Template::child(); ?>
(...)
Firebug查看的源代码:
<html lang="fr"><head></head><body>?
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Vélos d'occasion dans toute la France</title>
<meta name="keywords" content="velos d'occasion, velos dans toute la France, velos occasion Toute la france, velo occasion, velo">
<meta name="description" content="Petites annonces de velos d'occasion dans toute la France, velo d'occasion à vendre Toute la france">
<link rel="shortcut icon" href="/assets/style/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="/assets/style/bootstrap.min.css">
<link rel="stylesheet" href="/assets/style/bootstrap-responsive.min.css">
<link rel="stylesheet" href="/assets/style/main.css">
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<section id="maincontainer">
<div class="container">
(...)
编辑:问题解决了,记事本++是用UTF8编码的,我改成ANSI并且工作正常。