Jump to content

css


user4fun

Recommended Posts

I am new to css and I am wondering how to avoid duplicationg the html code. My css page is styling the majority of everything except that there are some html code associated with. For example, I have a big list <ul><li> etc etc that is dictating my drop down menu. How do I use that without haveing to copy/paste the the list code in every htm page?

Link to comment
Share on other sites

If you don't want to use PHP, you can use a server side include. It works like this:Just make the header its own .html file, which includes the doctype statements, CSS include statements, the global menu, etc.Then, when you make a new page, you can include the header file with a server side include:<!--#include virtual="header.html"-->You can put whatever content you want in the new page. You can do the same for the footer, or sidebar, or anything really.An rudimentary About Us page might look like this:

<!--#include virtual="header.html"-->Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.<!--#include virtual="sidebar.html"--><!--#include virtual="footer.html"-->

I haven't really used server side includes before, as PHP has it's own method of handling includes, but it should work fine.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...