如何在html文件中导入header、footer等

1.include是php函数,所以确实需要转化成.php文件--(其实除了用php,html都有自带的引入方法)
2.html转化为php文件很简单,直接改一下后缀名就可以了--(如:index.html直接改成index.php)
3.就是把完整的页面拆分成head.php与index.php页面--(如:导航栏以上代码保存为head.php,剩下保存为index.php)
4.在index.php引入head.php--(也就是index.php头部加入<?php include("head.php");?>)

 

后续

posted @ 2015-11-20 23:23  黑客PK  阅读(2571)  评论(0编辑  收藏  举报