douyi6960 2014-12-20 05:56
浏览 40
已采纳

如何修复php文件中的页眉和页脚

I am Developing a code using php . In which I am importing two files (header.php and footer.php) in another php file index.php. Now I want that header.php and footer.php should be fixed while scrolling horizontally. can you suggest me the code. I am using the following code

Header.php
 code here
footer.php
code here 

index.php

<?php include("header.php"); ?>
 welcome to index file 
 welcome to index file 
 welcome to index file 

<?php include("footer.php"); ?>

In this file index.php, I want that header and footer should be fixed while scrolling horizontally and others css should also not be disturbed.

  • 写回答

4条回答 默认 最新

  • doumengxue7371 2014-12-20 06:22
    关注

    try this.,

     <div id="header">
        <?PHP include_once('header.php');?>
        </div>
        <div id="wrap">
        welcome to index file
        </div>
        <div id="footer">
        <?PHP include_once('foo.php');?>
        </div>
    

    css:

    #header{position:fixed;top:0px;}
    #footer{position:fixed;bottom:0px;}
    

    or

    header.php 
    <div id ="header"></div><div id="content">
    footer.php
    </div><div id="footer"></div>
    
    index.php
    <?PHP include_once('header.php');?>
     content here.,
    <?PHP include_once('footer.php');?>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改