Jump to content


- - - - -

Including header file using HTML


  • You cannot reply to this topic
3 replies to this topic

#1 SharonB

    Earning Trust

  • Members
  • Pip
  • 3 posts

Posted 31 March 2008 - 01:40 PM

Is it possible to include a header and footer file using HTML? I have my file as a .html and need to be able to include the HTML for the header and footer. Anyone know how I can do this?

#2 dlewis23

    TMN Seasoned Veteran

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 10,178 posts
  • Location: Florida

Posted 31 March 2008 - 01:50 PM

you could use <?php include("header.html"); ?>

Otherwise use a template system.

#3 EBrown

    Don't hate the combover.

  • Sophist Member
  • PipPipPipPipPipPip
  • 842 posts
  • Location: Armpit of America

Posted 31 March 2008 - 02:37 PM

You could also use:

<iframe 
src ="header.html"
width="100%" frameborder="0">
</iframe>

or add:

height="[number]px"

Between the width and Frameborder declaration to adjust the height. (Replace [number] with your number)

But Dlewis's way works too.

#4 dlewis23

    TMN Seasoned Veteran

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 10,178 posts
  • Location: Florida

Posted 31 March 2008 - 06:03 PM

Quote

You could also use:

<iframe 
src ="header.html"
width="100%" frameborder="0">
</iframe>

or add:

height="[number]px"

Between the width and Frameborder declaration to adjust the height. (Replace [number] with your number)

But Dlewis's way works too.

You shouldn't really use iframes anymore as main browsers are starting not too support them as we move away from basic html.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users