0

I have 3 HTML pages for my website. They all have large parts that are the same. Is there a way I can link them to another HTML file so I only have to make changes once, just like you can do with JavaScript and CSS?

This is what I mean by the JavaScript and CSS:

<link type="text/css" rel="stylesheet" href="template.css" />
<script src="js.js" type="text/javascript"></script>
Dagg Nabbit
  • 75,346
  • 19
  • 113
  • 141
mail929
  • 2,768
  • 3
  • 15
  • 12

2 Answers2

2

The best way to do this is to leverage server-side includes:

In PHP - http://php.net/manual/en/function.include.php

You can use frames (ew) if you need to do this strictly with HTML as well, but I would highly recommend against it!

rawb
  • 2,296
  • 18
  • 9
0

There are static generators: jekyll, webgen

(Based on a question I asked a long time ago: What is the best way to manage duplicate code in static HTML websites)

Community
  • 1
  • 1
Goro
  • 9,919
  • 22
  • 74
  • 108