Link HTML code to page from external HTML page
On my site I all the webpages contain the exact same XHTML code and some css for a menu.
Can someone please tell me is it possible to have an external HTML page with the code and a link?
The way I mean is like linking a webpage to an external css stylesheet.
This means that the page would open quicker and make the webpages a smaller file size and to save having all the same code on each webpage.
All help much appreciated
Yes, and this is how your site should be structured. Remove all your css and put into a file and save as style.css (you can name the stylesheet what you like and save it to the root of your site, as I am displaying here, or in a folder). Then, in your HTML page you link to the stylesheet in the head:
<!-- Other head code here -->
<link href="style.css" rel="stylesheet" type="text/css" />
If I understand correctly, you're not looking for external CSS files (which should be external, as the poster above pointed out), but you have multiple pages that have the exact same code in them. The best way to do this is through PHP templates. You can have one PHP file with all the common HTML code in it, and just call that PHP file when you need the common code. You can then edit your PHP file, and the changes will reflect globally on all pages.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)