问题
I was wondering if it was possible to do the following in HTML.
index.html:
<title>Awesome Website</title>
<link href="navbar.html" rel="i-dunno-what-to-put-here" type="text/html"/>
<p>Content</p>
navbar.html:
<div id="navbar">
<li><a href="1.html">1</a></li>
<li><a href="2.html">2</a></li>
<li><a href="3.html">3</a></li>
<li><a href="4.html">4</a></li>
</div>
So pretty much - all pages link to the navbar.html and if there is one change in the navbar, then all the pages change.
Does anyone know if this is possible / how to do it? Any help would be much appreciated.
回答1:
I used PHP include like JEES mentioned.
来源:https://stackoverflow.com/questions/16371798/html-persistance-navbar