Hi there, I've a (x)HTML question that I can't find the answer for (it's probably obvious) but I find it difficult to phrase for the ol' search engines. Basically, I have a site using CSS and HTML, which uses a menu strip along the top of the window. Because of the design the HTML for the buttons and topbars (logo, etc) is repeated in each HTML page of the site. If I make any changes I need to replicate them in each file. Is there any tag to import a section of code from a common HTML file? cheers G
Since HTML is static you can not include a common page. What you should do is convert your site to SHTML which would allow for includes. Then you would put your header in a file called header.inc and place this code in your html <!--#include file="header.inc" --> HTML: where you what the header! If you are on a Unix or Linux server you can use the .htaccess file do rewrite rule on .html files to process through SSI (Server Side Includes). And that is the only way you can do it other then a dynamic language.
Another option is with PHP includes. Adjusting the server to process to html files as php or renaming them to .php's and adding <?php include 'blahfile.php'; ?> would do it. If you plan on really getting into webpages, I recommend learning about php anyway, and includes are an easy way to start.
I've actually got the server set up to process html as php, as I've put a few counter scripts in. It looks like a php include is another good option. Thanks!