How to make same layout for all web pages

后端 未结 5 1216
野趣味
野趣味 2021-01-02 13:22

I am currently working on HTML I want to ask a question about website development.I am developing a website in which the basic layout remains same like menu, side menu etc b

5条回答
  •  囚心锁ツ
    2021-01-02 14:20

    I don't believe that is possible, strictly through HTML. However, you could use server side scripting like PHP to get it done. What you're talking about is a template, and is used quite often. What you would want, is to have your menu items (and CSS) and your header/footer code in separate pages. This way, if you make changes to the menu, or header/footer, it would be reflected in all the pages (written with PHP) you have scripted with the template method.

    You would need the menu.html, header.html and footer.html in a place accessible by your main page code. That is, you would use the template method to write the content of your pages.

    A psuedo code example in PHP would be like such:

    
    

提交回复
热议问题