I am developing a static website using HTML/CSS. I have 7 pages in my website and each page has the exact same header content. Is there some sort of import/include capability in HTML?
Here is an example of the kind of thing I would be looking for (note I completely made up the syntax):
[Source (header.html)]
<html>
<head><title>Source Page</title></head>
<body>
<div id="myheader">Hello, World!</div>
<body>
</html>
[Page That Imports From Source]
<html>
<head><title>My Title</title></head>
<body>
<div import="id:myheader;source:url('header.html');"/>
<body>
</html>
Thank you!
Jan
Not as such, no. There are several options, in order of accessibility and ease of use:
iframesframesets(Legacy, avoid if possible).Examples
SSI
iframesJavascript
framesetsJust don’t 🙂