Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTML include...?

Status
Not open for further replies.

MadCatter101

Programmer
Nov 16, 2002
7
US
Ok. question. How do I get one HTML file to read code from a different file? For example, I want to set up a file (template.html) that will include basic page layout for a site that'll have ~60 pages. I want to be able to have each of those pages call up information from template.html so that I can alter the layouts of these pages by changing ONE file, rather than 60. Layout is with CSS, if that means anything. I DONT want to use anything other than HTML or CSS (e.g. Perl, CGI, Java, Javascript, PHP...), since I know incredibly little of any of these.

In essence, I want to read the contents of one HTML file from another.

Can it be done?

MadCatter101
 
Either link to an external style sheet and create your layout with CSS...

Code:
<link href=&quot;myStylesheet.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; />

...or use Server Side Includes (assuming this facility is available on your web server)...

Code:
<!--#include file=&quot;includedFile.inc&quot;-->
You will also probably need to save your pages with the extension &quot;.shtml&quot; so that the server processes them properly.

(note: with SSI's do not add any extra spaces before/after the comment tags, as this can stop the SSI working)

 
Thank you! The server-side include was what I was truly looking for. It helped an incredible amount! :) Thanks.

-MadCatter101-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top