使用PHP 'Include'将多个页面链接到单个index.php页面


Linking multiple pages to single index.php page using PHP 'Include'

我只是在PHP中练习一些东西,遇到了一个问题。

我使用PHP 'Include'功能将多个页面链接到单个index.php页面(因为我已经阅读了它使大型网站更易于管理和易于更新)。

我已经创建了外部CSS文件(总共3个,一个用于导航,页面样式和包装器内容),并有一些外部JS文件,这些文件都链接到一个名为head.php的PHP文档。(下面是head.php的内容)

服务器将首先显示的主页将是'index.php',所以对于这个页面,我将链接所有其他部分,这些部分将全部适合在一起创建单个页面。(下面是index.php的内容)

我的问题是,中间两头和页脚php包括线我已经创建了一个名为"包装器"的div(风格已经应用于外部CSS表名为"style.css"与head.php)(请见底style.css内容)我认为,当我在我的浏览器视图index . php(我使用XAMPP)应该显示页面上的包装,但是我看不出包装和我只是继续看到导航栏,我发现这很奇怪,因为我可以在index.php中使用<h1><p>标签,这些标签是由php包含的head.php页面外部样式的。

请看看我下面提到的所有页面的代码,我不确定我在这里做错了什么。谢谢你

下面是HEAD.PHP:

<!DOCTYPE HTML>
<HTML>
<HEAD>
<link rel="stylesheet" type="text/css" href="css/navigation.css">
<link rel="stylesheet" type="text/css" href="css/sitestyle.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.3/jquery-ui.js">    </script>  
<script type="text/javascript" src="responsee.js"></script>
<link rel="stylesheet" type="text/css" href="engine1//style.css" media="screen" />
<script type="text/javascript" src="engine1//jquery.js"></script>
<script type="text/javascript" src="drop.js"></script>
<script type="text/javascript" src="https://apis.google.com/js/platform.js"></script>
<title>MC SMM | Home</title>
</HEAD>

下面是STYLE.CSS:

#wrapepr {
background-color:black;
width:1000px;
height:1000px;
margin:0 auto;
}

下面是INDEX.PHP:

<?php include('segments/head.php'); ?>
<?php include('segments/facebookjs.php'); ?>
<?php include('segments/homenav.php'); ?>

<div id="wrapper"></div>

<?php include('segments/headbottom.php'); ?>

您的样式表中没有拼写包装器ID名称:

" # wrapepr "

应该成为:

#wrapper