Tech Talk Discuss PC Hardware, Software, Internet and Other Technology

CSS question: dynamic nav bar

Old 05-04-04, 01:51 PM
  #1  
DVD Talk Hall of Fame
Thread Starter
 
Gil Jawetz's Avatar
 
Join Date: Jan 2000
Location: I was here but I disappear
Posts: 8,407
CSS question: dynamic nav bar

I want to make a stylesheet for a nav bar with images and links and stuff but I haven't been able to find any way of using CSS for doing anything other than basics stuff (colors, fonts, links styles, etc...) Am I wrong that it['s possible? I don't want to have to change every page every time there's something new to add to the nav bar. Any resources for this technique?
Gil Jawetz is offline  
Old 05-04-04, 01:58 PM
  #2  
DVD Talk Ultimate Edition
 
Join Date: Apr 2000
Location: Austin, Texas XboxLIVE Gamertag: Golucky Timezone: Central (CST)
Posts: 4,899
There one on my experimental website. If you like it i'll give you the code that I used.

http://s88111416.onlinehome.us
goLUCKY is offline  
Old 05-05-04, 08:41 AM
  #3  
DVD Talk Special Edition
 
Join Date: Sep 1999
Location: Bristol, CT USA
Posts: 1,861
I'm a little confused. Are you asking if there's a way for CSS to contain your nav bar with its images and links? The answer to that is no; CSS can only contain styling information.

If you're looking for a way to create a nav bar that will stay up-to-date whenever you make a change, try using an include. If you can use PHP, add
PHP Code:
<?php include('path/to/your/files/navbar.php'); ?>
to every page on your site at the appropriate location. Then create navbar.php and put your nav bar images/links/whatever in there.
danw is offline  
Old 05-05-04, 02:12 PM
  #4  
DVD Talk Ultimate Edition
 
Join Date: Apr 2000
Location: Austin, Texas XboxLIVE Gamertag: Golucky Timezone: Central (CST)
Posts: 4,899
Originally posted by danw
I'm a little confused. Are you asking if there's a way for CSS to contain your nav bar with its images and links? The answer to that is no;
That's not exactly true. A css file can contain background images (i'm currently using gifs) for you nav bar buttons (think of it as a small style sheet).

PHP Code:
<!-- This is the header/menu -->
    <
div id="menu"><table><tr>
    <
td><a href="index.php?a=1" class="image"><img src="images/dvdtalk.gif" alt="talk1" style="border: 0px"/><center>Start</center></a></td>
    <
td><a href="index.php?a=1" class="image"><img src="images/dvdtalk2.gif" alt="talk2" style="border: 0px"/><center>Start</center></a></td>
    </
tr></table></div>
<!-- 
End header/menu -->
<!-- 
Style.CSS snippet ---!>
#menu a:link, #menu a:visited
{
    
cursor: default;
    
padding5px;
    
margin-right1px;
    
background:url('images/image1.gif');
    
background-repeatrepeat-x;
    
text-decorationnone;
    
color#888888;
    
font-weightbold;
}

#menu a:hover
{
    
cursor: default;
    
backgroundurl('images/image2.gif');
    
background-repeatrepeat-x;
    
color#888888;
}

#menu a:active
{
    
backgroundurl('images/image3.gif');
    
background-repeatrepeat-x;
    
color#888888;
}
/*  ID's */
#menu {
    
margin-bottom10px;
    
margin-top5px;
    
padding-bottom5px;
    
padding-top4px;
    
border-bottom1px #888888 solid;
    
width100%;
    
}
<!-- 
End of Style.CSS snippet ---!> 
goLUCKY is offline  
Old 05-06-04, 08:16 AM
  #5  
DVD Talk Special Edition
 
Join Date: Sep 1999
Location: Bristol, CT USA
Posts: 1,861
Originally posted by goLUCKY
That's not exactly true. A css file can contain background images (i'm currently using gifs) for you nav bar buttons (think of it as a small style sheet).
I knew that wasn't quite correct as soon as I finished typing it, and I figured somebody would correct me!
danw is offline  
Old 05-06-04, 11:33 AM
  #6  
DVD Talk Hall of Fame
Thread Starter
 
Gil Jawetz's Avatar
 
Join Date: Jan 2000
Location: I was here but I disappear
Posts: 8,407
Was out of town and am just seeing this. Thanks for the responses! I'll poke around and see if this does what I want. Yeah, I'm trying to make a nav bar with images that is contained in the CSS file so all pages can share it. We'll see if I can do it.
PHP would probably be better but I can only learn one new-fangled thing at a time!
Gil Jawetz is offline  

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 On
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Thread Tools
Search this Thread

Archive Advertising Cookie Policy Privacy Statement Terms of Service

Copyright 2018 MH Sub I, LLC dba Internet Brands. All rights reserved. Use of this site indicates your consent to the Terms of Use.