내가 난 항상 (모든 페이지의 상단에 내가 포함) 같은 헤더를 사용하는 HTML 파일을 내가동일한 CSS/HTML 다른 결과?
전체 몸 위에있는 공간이 없습니다 ...이 헤더 스타일을 CSS를 사용, 그게 좋은. 이제 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