How to share headers and tails in different pages of HTML?

Source: Internet
Author: User

ASP language

First make a header file head.asp, or a bottom file foot.asp. If the home page is index.asp, the calling header code is incremented at the beginning of the Index.asp file code (preceded by the,
<!– #include file= "head.asp" –>
Call the common bottom file code is to add the following code at the end of the Index.asp file code (before the last tag):

<!– #include file= "foot.asp" –>

II HTML language

Make a common header file head.htm or a common bottom file foot.htm. If the home file is index.htm, the way to call the header and bottom file is to add the following code to the beginning and end of the home file code:

<iframe marginwidth=0 marginheight=0 hspace=0 Vspace=0 frameborder=0 scrolling=no src= "head.htm" height=120 width=1024></iframe>

<iframe Marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no src= "foot.htm" height=120 width=1024>< /iframe>

Third, script language
Make a common header file head.js and a common bottom file foot.js. If the home file is index.htm, the way to call the header and bottom file is to add the following code to the beginning and end of the home file code: <script src= ' head.js ' > and <script src= ' foot.js ' >
Call the common page header or the bottom of the page, reducing the complexity of each page to write the head or the bottom of the complex, and easy to modify, as long as the change of a head or the bottom of the file, all the pages of the head or bottom are changed, increase the efficiency.

Four: shtml file

1: Use the SSI technology page to generate the sHTML file, only used in the header file location to add <!--#include file= "Header.htm"-->, and then modify the time just modify the Header.htm file. The advantage of using shtml is that the search engine is friendly and the files that need to be processed are done on the server side without burdening the visitor's browser.

How to share headers and tails in different pages of HTML?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.