How can I make a large HTML file several smaller ones?

Sep 29, 2004
18,656
68
91
Let's say Ihave a large HTML file called a.html

It is very large, so I want to break it up into smaller pieces.
a.html would "use" a_1.html, a_2.html and a_3.html. Where some of the original a.html is now placed into a_1,2,3. a.html would somehow have to "link" those other files.

Anyone know how to do this?
 

statik213

Golden Member
Oct 31, 2004
1,654
0
0
You can do this with Server SIde includes. You'll need to put something like this in your html where you want content from another file:
<!--#include file="insertthisfile.html" -->
see:
http://www.boutell.com/newfaq/creating/include.html

You'll need to find out if your web server supports it. If your web server does not let you do includes from html files you can rename your html files to PHP or ASP (whichever is supported by your webserver) ... in PHP you would do this instead of ^^^^
<?php include('filename.inc.html'); ?>

not sure about ASP syntax but ought to be pretty similiar.

Most websites use this sort of a thing for menus/headers and footers to make things look consistent.....

 
Sep 29, 2004
18,656
68
91
Originally posted by: statik213
You can do this with Server SIde includes. You'll need to put something like this in your html where you want content from another file:
<!--#include file="insertthisfile.html" -->
see:
http://www.boutell.com/newfaq/creating/include.html

You'll need to find out if your web server supports it. If your web server does not let you do includes from html files you can rename your html files to PHP or ASP (whichever is supported by your webserver) ... in PHP you would do this instead of ^^^^
<?php include('filename.inc.html'); ?>

not sure about ASP syntax but ought to be pretty similiar.

Most websites use this sort of a thing for menus/headers and footers to make things look consistent.....

I'lll look into this.

iframes seem to have some promise though:
http://www.w3schools.com/tags/tag_iframe.asp