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条)

报告相同问题?

悬赏问题

  • ¥30 求一段fortran代码用IVF编译运行的结果
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 lammps拉伸应力应变曲线分析
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试,帮帮忙吧
  • ¥15 #MATLAB仿真#车辆换道路径规划