【发布时间】:2015-04-03 01:17:00
【问题描述】:
我在尝试使用 php 包含显示我的固定页眉和页脚时遇到问题
这是我的 HTML
<?php include '_includes/header.php' ?>
<div class="neo__wrapper">
<div class="neo__container">
</div>
</div>
<?php include '_includes/footer.php' ?>
我的 SASS(用于嵌套)
*{
margin: 0;
padding: 0;
text-decoration: none;
border: 0;
border: none;
}
html,body{
width: 100%;
height: 100%;
}
.neo__wrapper{
width: 100%;
height: 100%;
margin: 0 auto;
.neo__container{
width: 960px;
height: 3000px;
margin: 0 auto;
}
}
header{
background:#ccc;
width: 100%;
position: fixed;
height: 100px;
top: 0;
}
footer{
background:#ccc;
position: fixed;
width: 100%;
height: 50px;
bottom: 0;
}
我只是在构建一个框架,所以我的 header.php 只是
<header></header>
我的footer.php是
<footer></footer>
基本上,我的页面应该只有一个灰色的固定页眉和页脚
【问题讨论】:
-
<header><?php include '_includes/header.php' ?></header>如果header.php是您向我们展示的所有 CSS。但是,该 CSS 需要包含在<style></style>内<head></head>或作为样式表的链接。不知道这个问题是关于什么的。 -
您的
neo__wrapperCSS 未关闭,这会在 CSS 到达页眉/页脚声明之前破坏它。 EDIT 没关系,刚刚注意到您使用的是 SASS,您确定它的编译正确吗?它对我有用。
标签: php html header include footer