Home >Web Front-end >HTML Tutorial >Reference (setting) method for some modules common to static websites_html/css_WEB-ITnose
Regarding static websites, a common header and tail are used to facilitate website maintenance and management. If you modify the header content and advertisements of the page, you can only modify the header of the entire website on one page. Both the head and tail have been changed.
1: Use the ssi technology page to generate the shtml file, just add ; to the header file location, and then just modify it when you modify it. The header.html file will do the trick. The advantage of using shtml is that it is more friendly to search engines. The files that need to be processed are completed on the server side, which will not increase the burden on the visitor's browser.
2: Use js
to create a head.js file,
find a website that converts html to js
and then convert the html code in your head into js code and put it in inside the head.js file.
Then add
where you need to call the head file code The path of src="js/head.js" here is the path of your head.js file.
Just like this~
The advantage of this method is that it is convenient and easy to modify. The disadvantage is that search engines cannot read javascript files, and search engines cannot include header files and tail files. Moreover, large js files will increase the burden on visitors' browsers and affect access speed.
3: Use iframe
In the past, people often used static frames to do the beginning and end (usually not iframes). It's becoming less and less common now. Mainly because it is relatively difficult to design web pages, and it also increases the number of connections, and is not conducive to the search engine's inclusion of the beginning and the end.