SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Evangelist venkat6134's Avatar
    Join Date
    Jul 2010
    Posts
    454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how to include a html page into another html page?

    Hi all,
    I am a newbie to HTML includes.

    I want to include a header.html page into my test.html, test1.html.

    When i change header.html, it will immediately reflect the changes in the test.html, test1.html.

    How can i include like this functionality?

    Give me your suggestions...

    Thanking you...

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,500
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    using a server side language, for example PHP

  3. #3
    SitePoint Evangelist venkat6134's Avatar
    Join Date
    Jul 2010
    Posts
    454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    not by using php..

    When i include by using this code in a test.html;

    <!--#include file="header.html" -->

    After i see the source of html in the browser, it is showing two <html>, two <head> like that..

    How can i prevent this..
    Give me the pros and cons if i use like this..

    Thank you..

  4. #4
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,500
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by venkat6134 View Post
    After i see the source of html in the browser, it is showing two <html>, two <head> like that..

    How can i prevent this..
    Get rid of the <html> and <head> in one of the files (the main html or the included html). The end result must be a complete, valid html page, so you'll have to put each piece in the right file.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •