By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,949 Members | 1,063 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,949 IT Pros & Developers. It's quick & easy.

CSS menu background won't show up

P: 2
I've been trying to create a new navigation system for my site, and I got everything figured out except for one thing. Here is the CSS code I'm using right now:

Expand|Select|Wrap|Line Numbers
  1. body {
  2.     font: normal 10px Verdana, Arial, Helvetica, sans-serif;
  3.     color: #000000;
  4.     background: #FFFFFF;
  5.     height: auto;
  6.     width: auto;
  7.     margin: 0px;
  8.     padding: 0px;
  9. }
  10. #wrapper {
  11.     text-align: left;
  12.     width: 100%;
  13.     margin-right: auto;
  14.     margin-left: auto;
  15. }
  16.  
  17. a { color: #0000FF; text-decoration: none; }
  18. a:hover { color: #000000; }
  19. a.redbar { color: #FFFF00; text-decoration: none; }
  20. a.redbar:hover { color: #000000; }
  21.  
  22. table {
  23.     border-width: 0px;
  24.     border-style: none;
  25.     margin: 0px;
  26.     padding: 0px;
  27.     font: 10px Verdana, Arial, Helvetica, sans-serif;
  28.     color: #000000;
  29.     background-color: #FFFFFF;
  30. }
  31.  
  32. .loading {
  33.     font-size: 24px;
  34.     font-style: italic;
  35.     font-weight: bold;
  36.     color: #FFFFFF;
  37.     text-align: right;
  38.  
  39. }
  40.  
  41. .bars {
  42.     font-size: 10px;
  43.     font-style: italic;
  44.     font-weight: bold;
  45.     color: #FFFFFF;
  46.  
  47.  
  48. }
  49.  
  50. .bars, .loading {
  51.     background-color: #0033CC;
  52.  
  53.     }
  54.  
  55.  
  56. #navbar {
  57.     font: bold 12px Geneva, Arial, Helvetica, sans-serif;
  58.     text-transform: uppercase;
  59.     text-align: center;
  60.     border-top: 1px solid #000000;
  61.     border-bottom: 1px solid #333333;
  62.     clear: both;
  63.     margin-bottom: 10px;
  64. }
  65. #navbar ul {
  66.     margin: 0px;
  67.     padding: 0px;
  68. }
  69. #navbar li {
  70.     list-style: none;
  71.     display: inline;
  72. }
  73. #navbar a {
  74.     background: url(../images/blackslant_15x15.gif);
  75. }
and here is my unordered list that I am using that is using the #navbar property:

Expand|Select|Wrap|Line Numbers
  1. <div id="navbar">
  2.           <ul>
  3.             <li> <a href="news/index.html">News</a></li>
  4.             <li> <a href="fanfiction/index.html">Fanfiction</a></li>
  5.             <li> <a href="thoughts/index.html">Thoughts</a></li>
  6.             <li> <a href="links/index.html">Links</a></li>
  7.             <li> <a href="contact/index.html">Contact</a></li>
  8.           </ul>
  9.   </div>
The problem is when I actually add the background I want to use for this navigation, the background doesn't come up. I try to do different things to cause it to come up, but nothing shows up AT ALL in Dreamweaver 8. I've had various different things happen with Firefox and IE, with the background overflowing out of the navigation bar, it not being centered right, whatever they could've done to screw it up, they did. Now, the float:block property will get it to show, but since I need this navigation centered, I can't use float (the background itself is a little diagonal black line), and since I only need this BG in the actual list items, I can't tell it to use the background in the entire UL (there is supposed to be only one black line going in between each link). Be advised that I didn't use any padding because in order to start padding the background, I need to have it know that there actually IS a background being used.

I have tried to do everything imaginable in order to get this thing to look right and to actually get Dreamweaver and/or the page, css, whatever it is that is reading what, to reconize that I'm actually telling it to use a background in the code, in the way that I was wanting it. But I think I have hit my wits end in this, because everything that I have tried has done absolutly nothing with getting this problem fixed. I need help, PLEASE!!
Oct 7 '06 #1
Share this Question
Share on Google+
2 Replies


P: 2
I won't pretend to have this post as a way to bump up this topic, because I REALLY NEED HELP ON THIS!!! I'm STILL trying to do ANYTHING I possibly can, and no one is answering (or caring?).

What am I doing wrong? PLEASE HELP!!
Oct 11 '06 #2

jaymanson
P: 29
Hi darkpowrjd

I just think that maybe no-one is too sure exactly what's up! Your CSS seems fine so I can't see why your background shouldn't be showing up! As it is above, you should have your menu items with ///////////////// behind them.

You say 'there is supposed to be only one black line going in between each link' so I'm presuming you mean you want your menu like this:

Item 1 / Item 2 / Item 3 / Item 4

If so, then change your CSS from this:
Expand|Select|Wrap|Line Numbers
  1. #navbar li {
  2.     list-style: none;
  3.     display: inline;
  4. }
  5. #navbar a {
  6.     background: url(../images/blackslant_15x15.gif);
  7. }
to this:
Expand|Select|Wrap|Line Numbers
  1. #navbar li {
  2.     list-style: none;
  3.     display: inline;
  4.     padding-right: 15px;
  5.     background: url(../images/blackslant_15x15.gif) top right no-repeat;
  6. }
Hopefully I'm reading you right - if so then that should give you the result you want.

Jay
Oct 11 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.