|
||||||||||
|
|||||||
| GoogleCommunity Sponsor |
Use coupon "forum" for 50% Off! |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Junior Googler
![]() Join Date: Dec 2006
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
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? |
|
|
|
|
Sponsored Links
|
|
|
|
#3 (permalink) |
|
Senior Googler
![]() Join Date: Feb 2007
Location: Santa Fe, NM
Posts: 143
Thanks: 0
Thanked 8 Times in 8 Posts
![]() |
A tempting idea, but...
...yes, I had the same temptation, early in my large website. I noticed, as you are probably noticing, that all the pages have roughly the same header and footer. You can do it easily doing a PHP self-file or a javascript-write imbedded in the "head" and "tail" of each one.
But then, the question pops up, are you doing it for YOUR ease of maintenance? You should, in the end, consider, your visitor's ease of viewing, and bite the bullet, and place the same ol' header and footer, hand-coded or copied and pasted, into each file. Use lots of CSS and place that CSS in one shared external file. It'll speed up the load for each page, in the long run. |
|
|
|
|
|
#4 (permalink) | |
|
Googler
![]() |
Quote:
There also a php includes coding you can do. |
|
|
|
|
|
|
#5 (permalink) | |
|
Googler
![]() |
Quote:
PHP Code:
PHP Code:
|
|
|
|
|
|
|
#6 (permalink) |
|
Google Guru
![]() Join Date: May 2004
Posts: 2,527
Thanks: 15
Thanked 46 Times in 26 Posts
![]() |
It's also technically possible to use JavaScript, but this is more hassle than it's worth.
Additionally, if your web server supports it, you can enable SSI parsing of .html files in .htaccess. This will let you use SSI (server-side include) directives in your .html files! |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Is it possible to include header and footer file using HTML | montyauto | Web Design, Coding & Programming Forum | 3 | 08-28-2007 07:00 AM |
| Including header file using HTML | black-and-white | Web Design, Coding & Programming Forum | 3 | 12-27-2006 04:44 AM |
| Isn't X-HTML like the older version of HTML? | ricards | All About Google | 1 | 11-17-2005 10:34 AM |
| Can I put adsense code in a javascript include? | eelsource | Google AdWords & AdSense Forum | 2 | 01-01-1970 11:33 AM |
| Isn't X-HTML like the older version of HTML? | ricards | All About Google | 1 | 01-01-1970 10:08 AM |