-1

Ive a series of static html pages with a common footer, i want to inlcude content from the in each html file without duplication

e.g.

root
  page1.html
  page2.html
  page3.html
  footer.html

How do I make page 1,2 and 3 use the footer.html as the footer file without writing any java script. I've seen answers that included java script in this question How to include html file in another html file but I want to know if its possible without java script.

Remember

  • These are static pages not running on a server
  • This does not include the use of java script or other scripting process. - The answers to How to include html file in another html file all use javascript and do not answer this question.
4
  • 1
    The only way is to use a frameset (which is deprecated AFAIK): w3.org/TR/html401/present/frames.html . Today you'd use a build step to compose your page with a template system, e.g. jekyllrb.com . Commented Jun 13, 2016 at 23:46
  • what framework/backend language are you using? Commented Jun 14, 2016 at 0:02
  • Perhaps look include server side includes Commented Jun 14, 2016 at 0:03
  • @EdHeal - I'm unsure how you propose that this would help, given that the OP stated in the original question "These are static pages not running on a server". Is this an oblique way of suggesting that they should? (be running on a server) Commented Jun 14, 2016 at 8:44

2 Answers 2

1

iframes are HTML, they are very similar to PHP includes, but have much more security restrictions given the nature of open client based HTML compared to secure server based PHP.

<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
    <style>
      
      </style>
    </head>
  <body>
    <header>
      <h1>iframes</h1>
      </header>
    <main>
      <section>
        </section>
      </main>
    <footer>
      <iframe src="http://example.com"></iframe>
      <iframe src="http://example.com"></iframe>
      <iframe src="http://example.com"></iframe>
      </footer>
    </body>
  </html>

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

Comments

0

You shouldn't use html for this as html is static, if you want a dynamic webpage try to something like PHP.

Have a look at this : https://css-tricks.com/forums/topic/how-to-include-php-headers-and-footers-on-html-site/

Hope it helps.

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.