Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Reference nav bar in the CSS?
Old 02-09-2008, 06:43 PM Reference nav bar in the CSS?
wilbury's Avatar
Skilled Talker

Posts: 68
Trades: 0
Is it possible to reference the nav bar (and footer) in the CSS in order to make faster site-wide changes to the navigation?

For example, if I wanted to add a new page (and associated drop-down menu item) I would have to add the code to every page.

http://www.diamondpackaging.com/green/
http://www.diamondpackaging.com/green/diamond.css

Thanks
wilbury is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-09-2008, 09:17 PM Re: Reference nav bar in the CSS?
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
What would be more expedient is to use Server-side includes.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 02-10-2008, 05:04 PM Re: Reference nav bar in the CSS?
Webmaster Talker

Posts: 626
Trades: 0
Agreed... It's been a bit since I've done it but this should work for you. Make a file, for example, navmenu.html and put this in it:

Code:
<!-- start nav -->
  <div id="nav">

    <ul>
	<li> <a href="about/index.htm" title="about" onmouseover="dropdownmenu(this, event, 'anylinkmenu1')">about</a></li><li>|</li>
	
	             <div style="visibility: visible; left: 85px; top: 183px;" id="anylinkmenu1" class="anylinkcss">

                 <a href="about/news.htm">news</a>
                 <a href="about/casestudies.htm">case studies</a>
                 <a href="about/affiliations.htm">affiliations</a>

                 
                 </div>
	
	<li><a href="sustainability/index.htm" title="sustainability" onmouseover="dropdownmenu(this, event, 'anylinkmenu2')">sustainability</a></li><li>|</li>
	
	
	             <div style="visibility: hidden; left: 191px; top: 183px;" id="anylinkmenu2" class="anylinkcss">

                 <a href="sustainability/movement.htm">movement</a>
				 <a href="sustainability/packaging.htm">packaging</a>
                 <a href="sustainability/cradle.htm">cradle to cradle</a>

                 
                 </div>
		
	
	<li><a href="designs/index.htm" title="designs" onmouseover="dropdownmenu(this, event, 'anylinkmenu3')">designs</a></li><li>|</li>
	
	 			 <div style="visibility: hidden; left: 348px; top: 183px;" id="anylinkmenu3" class="anylinkcss">

                 <a href="designs/cad.htm">cad</a>
                 <a href="designs/scorecard.htm">scorecard</a>
                 
                 </div>

		
	
	<li><a href="materials/index.htm" title="materials" onmouseover="dropdownmenu(this, event, 'anylinkmenu4')">materials</a></li><li>|</li>
	
	             <div style="visibility: hidden; left: 467px; top: 183px;" id="anylinkmenu4" class="anylinkcss">

                 <a href="materials/paper.htm">paper</a>
                 <a href="materials/plastic.htm">plastic</a>
				 <a href="materials/inks.htm">inks/coatings</a>
                 
                 </div>

		
	
	<li><a href="methods/index.htm" title="methods" onmouseover="dropdownmenu(this, event, 'anylinkmenu5')">methods</a></li><li>|</li>
	
	             <div style="visibility: hidden; left: 598px; top: 183px;" id="anylinkmenu5" class="anylinkcss">

                 <a href="methods/recycling.htm">recycling</a>
                 <a href="methods/efficiency.htm">efficiency</a>
				 <a href="methods/management.htm">management</a>
                 
                 </div>

	
	<li><a href="wind/index.htm" title="wind energy" onmouseover="dropdownmenu(this, event, 'anylinkmenu6')">wind energy</a></li><li>|</li>
	
	             <div style="visibility: hidden; left: 723px; top: 183px;" id="anylinkmenu6" class="anylinkcss">

                 <a href="wind/about.htm">about</a>
                 <a href="wind/faq.htm">FAQs</a>
				 <a href="wind/rec.htm">RECs</a>
				 <a href="wind/epa.htm">EPA</a>

                 
                 </div>
	
	
	<li><a href="educate/index.htm" title="educate" onmouseover="dropdownmenu(this, event, 'anylinkmenu7')">educate</a></li>
	
		         <div style="visibility: hidden; left: 872px; top: 183px;" id="anylinkmenu7" class="anylinkcss">

                 <a href="educate/definitions.htm">definitions</a>
                 <a href="educate/acronyms.htm">acronyms</a>
				 <a href="educate/articles.htm">articles</a>

				 <a href="educate/links.htm">links</a>
				 <a href="educate/videos.htm">videos</a>
				 <a href="educate/calculator.htm">calculator</a>
                 
                 </div>
		
	</ul>
  </div>
  <!-- end nav -->
Then, anywhere you want to reference that menu you, put in your page <?php include('navmenu.html'); ?> and that will insert the other HTML text.

Keep in mind though that you will be executing PHP code and therefore you should rename the file that contains the include(); statement to pagename.php so that the server knows there is php to parse in the file.
jim.thornton is offline
Reply With Quote
View Public Profile
 
Old 02-11-2008, 01:58 AM Re: Reference nav bar in the CSS?
bigfreak's Avatar
Extreme Talker

Posts: 179
Name: Andy
Trades: 0
i've used this method for a while now and it really saves you some time.

just set up the information in the css, and it will work perfectly for you.
bigfreak is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Reference nav bar in the CSS?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.19708 seconds with 12 queries