I have two pages. One index.php and the other one is called menu.php.
As the menu is the same and I repeat it on several pages I prefer to make it into a separate document and then add it with include ("menu.php")
. However, whenever I use this, there is a space, as in the image below.
AndifIaddmoreincludespacerepeats,see:
When I look at the source code, there are some strange stops that I do not even know where it came from.
IcouldinsertthecodesnippetherebutthisproblemIonlyhavewhenIuseinclude,nowifImountthewholestructureofindex.phponthesamepagethisproblemdoesnothappen.
index.phppagecode
<htmlxmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- Meta Tags -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- Scripts -->
<title>Home</title>
</head>
<body>
<!-- Google analitycs -->
<?php include_once("includes/analyticstracking.php") ?>
<!-- Menu -->
<?php include_once("includes/menu.php") ?>
</body>
</html>
<link rel="stylesheet" type="text/css" href="scripts/geral.css">
menu.php code
<div class="men">
</div>
general.css code
@charset "utf-8";
/* CSS Document */
/* Padrão Geral */
@font-face {font-family: NFO;font-style: normal; font-weight: normal; src: url(../fonte/fonte.woff); }
a{text-decoration:none; color:inherit}
*{font-family:NFO; margin:0px; padding:0px }
body{background-color:#f4f4f4}
/* Pagina Index */
/* Menu */
.men{width:100%; height:60px; background-color:#2f2f2f; float:left}