如何将导航栏编码到所有页面? [英] How can I code my navbar in to all pages?
问题描述
我想将导航栏编码到所有页面中,以便当我想对导航栏进行更改时,它适用于所有页面。
我尝试了什么:
导航栏代码保存为header.htm:
页面代码:
<!DOCTYPE html>
< meta charset =UTF-8/>
< meta name =viewportcontent =width = device-width,initial-scale = 1>
< title>概述
$(凭证).ready(function(){
$( #header)。load('header.htm')
});
< br $>
(document).ready(function(){
(#header ).load('header.htm')
});
我使用HTML做类似的事情包括:
<! - #include file =/ commonHTML / header.html - > 跨度> 跨度>
i want to code my navbar into all pages so that when i want to make a change to the navbar, it applies to all pages.
What I have tried:
code for navbar saved as header.htm:
code for page:
<!DOCTYPE html>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Overview
$(document).ready(function() {
$("#header") .load('header.htm')
});
(document).ready(function() {
("#header") .load('header.htm')
});
I do something similar using the HTML include:
<!-- #include file ="/commonHTML/header.html" -->
这篇关于如何将导航栏编码到所有页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!