CSS question/assistance

This is the place to discuss the latest computer hardware issues and technology. Please keep the discussion ON TOPIC!
Post Reply
User avatar
unfaithfulsfan
Legit Extremist
Legit Extremist
Posts: 761
Joined: Fri Mar 28, 2008 6:52 pm
Location: Buffalo NY

CSS question/assistance

Post by unfaithfulsfan »

Is there a way to create a menu in your css file that appears on your pages so you don't have to update every.single.page. when you add a page that needs to be in the site's navigation? I thought somewhere in my perusings over the years that I saw that there was but I just can't remember if or how... #-o

Thanks
Jack
"A payphone was ringing and it just about blew my mind,
when I picked it up & said 'Hello' this foot came through the line"
~Bob Dylan
User avatar
Darkstar
Legit Extremist
Legit Extremist
Posts: 1910
Joined: Thu Feb 01, 2007 12:24 pm
Location: San Diego
Contact:

Re: CSS question/assistance

Post by Darkstar »

i dont have the knowledge of css to answer, but have directed a couple to this site which they found to be very helpful;

http://www.w3schools.com/Css/default.asp

:drinkers:
Phenom II 1075T,Phenom II 1090T,Intel i7 870
Gigabyte 890XA-UD3
Evga GTX460
8 GB Corsair
Agility2 120GB SSD
Dual 24" Samsungs LCD's
User avatar
DMB2000uk
Site Admin
Site Admin
Posts: 7095
Joined: Mon Jul 18, 2005 5:36 pm
Location: UK

Re: CSS question/assistance

Post by DMB2000uk »

You're going to have to still update every page even if you use a CSS menu system.

CSS is only meant to be used for styling things, not content as the menu is.

You could look into using templates if you are coding in something like dreamweaver.

Dan
Image (<- Clickable)
User avatar
hnzw_rui
Legit Extremist
Legit Extremist
Posts: 604
Joined: Fri Feb 08, 2008 11:42 am

Re: CSS question/assistance

Post by hnzw_rui »

Why not javascript? You only need one javascript to dynamically insert a menu. True, you still have to insert <script type='text/javascript' src='menucreate.js'></script> on every html but at least that's probably shorter than inserting the code for the whole menu. Plus, you only need to edit menucreate.js to update every page. Caveat, might not work with browsers that have javascript turned off.

Question though, are you limited to plain html files? Because if you can do server-side scripting with php, asp, etc, this is pretty easy to do. I have a mirror of the PHP.net on my laptop and when I checked the scripts, I noticed it dynamically inserts the header and footer to every page. Pretty neat, huh?
File Server/Media Encoder/PVR PC
Antec P182 / Corsair 550VX / Gigabyte GA-P35-DS3R / Core 2 Duo E7200 @ 2.53 / Wintec AMPX 2x2GB DDR2 800 / Sapphire 100233L Radeon HD 3450 / WD Caviar SE16 750GB x3 / WD Caviar GP 750GB / Sony NEC Optiarc AD-7190A x2 / XP Pro SP2

unRAID Server
Antec 300 / Corsair 520HX / Abit AB9 Pro / Celeron 430 @ 1.80 / Kingston ValueRAM 2x1GB DDR2 667 / ATI Rage XL / Seagate 7200.11 1.5TB x9 / unRAID 4.3.3
User avatar
Tech_Greek
Legit Extremist
Legit Extremist
Posts: 265
Joined: Tue Jan 02, 2007 2:35 pm

Re: CSS question/assistance

Post by Tech_Greek »

Do a PHP Include and link it to another page, I did this and you could never tell...all of my websites are like this.
User avatar
FZ1
Moderator
Moderator
Posts: 4448
Joined: Mon Dec 27, 2004 6:49 pm
Location: Cincinnati, Ohio
Contact:

Re: CSS question/assistance

Post by FZ1 »

ASP, Javascript & PHP will all work if you code it as includes. Basically, it references code from a single source. If you are doing a site with many pages, this is the best way to do it for not just menus but any other content that will appear more than once on various pages.
Joe
Post Reply