我有一個HTML文件,我總是使用相同的標題(我包括它在每一個頁面的頂部) 我用CSS樣式這個頭......相同的CSS/HTML不同的結果?
整體機身頂部有沒有空間,這就是好。 現在我在index.php的頁面頂部有空間,在contact.php頂部沒有空格,雖然它有相同的標題和完全相同的CSS文件鏈接輸入代碼在這裏。 ..
這怎麼可能?
(對不起,壞的代碼示例,但該網站是複雜的,以顯示它...)
.body{
\t margin: 0 auto;
\t width:70%;
\t clear: both;
}
.mainHeader img{
\t width: 50%;
\t height: auto;
\t margin-top:0px;
\t margin-bottom:20px;
\t display: block;
\t margin-right:auto;
\t margin-left:auto;
}
//index file
<?php
include 'includes/overall/header.php';
?>
//contact file
<?php
include 'includes/overall/header.php';
?>
//header file
<html>
<head>
<title>Website Title</title>
<meta charset="UTF-8" >
\t <link rel="stylesheet" href="css/style.css"/>
\t <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body class="body">
<header class="mainHeader">
\t <img src="logo.png"></img>
<nav>
\t <ul>
\t \t <li class="#"><a href="index.php">home</a></li>
\t <li class="#"><a href="contact.php">contact</a></li>
\t </ul>
</nav>
</header>
</body>
</html>
無法分辨實際的源文件。在開發人員控制檯中查看您使用的任何瀏覽器,查看應用的填充和邊距以及相關的樣式。某處有些不同之處。 – junkfoodjunkie
擺脫'',圖像標籤不會關閉。 – tomaroo
對不起,我不是一個PHP的人,但你的頭包含'html','head'和'body'標籤似乎很奇怪。我認爲這些包含的內容被認爲是部分的意見。另外,不要使用隧道視覺......問題可能不在於頭文件或頭文件CSS,而可能是index.php頁面上的標記(如一個流浪字符或無效標記)或該頁面樣式。 – zgood