View Full Version : Using CSS to load HTML
jp182
November 10th, 2006, 05:48 PM
Alright, so I know that technically CSS shouldn't be used to do this but I'm not sure if it applies in this case and if it doesn't, then I need help.
I have a subnavigation for my page that I'd like to put into a CSS file instead of having to edit it on every file that is a part of the navigation. Here's what it looks like now:
http://www.thespeedlounge.com/tv/d1test.html
It is on the left. I'd like to make the text links loadable from an external file but nothing I've tried has worked including the content tag. Any suggestions??
evildrummer
November 10th, 2006, 06:31 PM
if you have PHP you could use a php include!
jp182
November 10th, 2006, 10:44 PM
so if i put it into a php file i can use an include?
Templarian
November 10th, 2006, 11:55 PM
I always did this with javascript before i made all my pages with PHP. I would just use JS for this sort of thing.
in your js file just write to the window your nav then include it where the nav would go. Walla you have your nav on all pages.
jp182
November 11th, 2006, 11:12 AM
thanks! now i just need to learn javascript :h:
senocular
November 11th, 2006, 11:16 AM
using something like PHP would be a lot easier and more reliable (as it wouldn't depend on the user having a JS enabled browser).
You could also use an HTML editor like Dreamweaver that supports templates. Just keep the menu in a template and when you edit it, the other pages will be automatically updated.
ditt0
November 13th, 2006, 12:34 AM
Or you could use shtml includes.
jp182
November 17th, 2006, 12:43 AM
using something like PHP would be a lot easier and more reliable (as it wouldn't depend on the user having a JS enabled browser).
You could also use an HTML editor like Dreamweaver that supports templates. Just keep the menu in a template and when you edit it, the other pages will be automatically updated.
i think this is the route that i'm going to go. i'll try to work on it this weekend and post up what I get :)
jp182
November 22nd, 2006, 02:37 PM
alright folks, so i decided to remove the navigation all together. However, I did decide to use includes for my main navigation using server side includes. Does anyone see any potential problems using ssi's (ie .shtml files)
take a look
http://www.thespeedlounge.com/tv.shtml
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.