Chromeで空のように見えます
-
12-12-2019 - |
質問
最後のバージョンのGoogle Chromeを使ってWebサイトを閲覧し、F12を使用してソースを調べるときは、<head>
と</head>
の間のすべてのコンテンツが空に表示されます。
Firefoxの最後のバージョンで、すなわち、すべてが規範的に見えます。
実際には、Google Chromeの体内に移動します。
それは明らかにCSSの問題ではありません。Twitterブートストラップ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に変更され、うまくいった。
解決
あなたの文書の始めにある種の不正な形格を持っています。
W3C validatorを通してページを実行し、表示されます。
エラー行1、列1:aを見ることなく見つけた空き文字 最初にdoctype。予想される
<!DOCTYPE html>
。
他のヒント
Elijahの答えを作るには、Ctrl + Uを使用してChromeとFirefoxのソースを表示します。
私はちょうどChromeでチェックし、空ではありません。
<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>Veloccasion - 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" />
<meta name="author" content="Veloccasion.net" />
<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]-->
.
f12は表示元ではありません。F12はDOMインスペクタです。頭を折りたたんだのと同じくらいただ見ているのは可能ですか?これはデフォルトで表示される方法です。
編集:
あなたの問題を見つけました:
<link href='http://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'>
.
そのタグは閉まりません。/>
編集:
この行の/>
の前にスペースが必要な場合があります。
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
. 私はそれを見つけました!
Chrome Press Ctrl + Shift + I、
... <body>
タグの直後の空白のテキストの行があります。それを見つけて、それを削除して空白が消えます。コードがありませんのでわかりません。
それが役立つことを願っています
以下の線
<link href="http://fonts.googleapis.com/css?family=Lobster"
rel="stylesheet" type="text/css
.
「?」に注意してくださいこの行を削除してソースを表示してみてください