1

I want to generate three pages in html 1.header 2.container 3.footer in different html pages And last i want to integrate all 3 html page in single page as index.html.

Please tell me how will i do this??

Jadu
  • 13
  • 1
  • 7
  • What language/framework are you using to build the web page? Or, are you literally writing raw HTML files? – Tom Lord Jul 01 '16 at 08:34

3 Answers3

0

You can done this with angularjs easily using ng-include directive to learn about this follow below link.

Combine multiple html

Nikhil.Patel
  • 893
  • 7
  • 17
0

Use jQuery, https://stackoverflow.com/a/18712605/6385066
index.html

<html>
<head>
<title></title>
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script> 
$(function(){
  $("#header").load("header.html"); 
  $("#footer").load("footer.html"); 
});
</script> 
</head>
<body>
<div id="header"></div>
<!--Remaining section-->
<div id="footer"></div>
</body>
</html>

You can reuse the function for all your pages to include your header and footer.

Community
  • 1
  • 1
DunnoHowToCode
  • 491
  • 1
  • 4
  • 13
0

Please try the below method

<html>
  <head>
    <title>test page</title>
    <script src="http://code.jquery.com/jquery-3.0.0.min.js"></script>
  </head>
  <body>
    <div id="header"></div>
    <br />
    <div id="content">
      Main Content
    </div>
    <br />
    <div id="footer"></div>
    <script>
      $("#header").load("header.html");
      $("#footer").load("footer.html");
    </script>
  </body>
</html>

Would suggest you to go through the below links as well

  1. Common Header / Footer with static HTML

  2. Make header and footer files to be included in multiple html pages

Community
  • 1
  • 1
Gauthaman Sahadevan
  • 851
  • 1
  • 11
  • 16