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>
0

2 Answers 2

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!

Sign up to request clarification or add additional context in comments.

Comments

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)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.