在多个html页面中调用单个css菜单 [英] call single css menu in multiple html pages

查看:187
本文介绍了在多个html页面中调用单个css菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个网站。



我有一个菜单栏,这个菜单栏在所有页面中都是通用的。我想从我的网站中的任何页面调用包含菜单栏的HTML页面。



是否有任何包含HTML文件的语法,以便我可以解决我的问题。



如果是这样的话怎么办?

解决方案

使用php扩展名为您的文件而不是html,并使用

 <?php include_once('header.php')调用您的标头。 ; ?> 

您希望显示标题的位置

如果您正在本地机器上安装 xampp ,或者您将无法看到您的网站,因为PHP是服务器端脚本语言


I'm in the process of creating a website.

I have a menu bar which is common for all the pages. I want to call the HTML page which contains the menu bar from any page within my site.

Is there any syntax to include HTML files so that I can solve my issue.

If so how to do it?

解决方案

You need to use php extension for you files instead of html and call your header with

<?php include_once('header.php'); ?>

where you want header to be displayed

If you are working on local machine install xampp or you will not be able to see your website because php is server side scripting language

这篇关于在多个html页面中调用单个css菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆