473,405 Members | 2,282 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

problem with display:block - background-color will not show.

On a display:block element for navigation, I cannot get a background color to show up other than white.

What do I do?
May 25 '14 #1
12 3662
Rabbit
12,516 Expert Mod 8TB
You need to post your code.
May 25 '14 #2
Expand|Select|Wrap|Line Numbers
  1. #mainMenu {
  2.                 z-index: 120;
  3.                 width:1100px;
  4.         padding-top: 3px;
  5.         text-align: center;
  6.         margin-left: auto;
  7.         margin-right: auto;
  8.                 background-color: #dfdfdf;
  9.                 font-family: "Trebuchet MS";
  10.     }  
  11.     #mainMenu li {
  12.         position:relative; 
  13.         display:block;        
  14.         width:130px;
  15.         float:left;
  16.         border-left:1px solid #aeaeae;
  17.         border-right:1px solid #aeaeae;
  18.     }
  19.     #mainMenu #li1 {
  20.         position:relative; 
  21.         display:block;
  22.         width:130px;
  23.         float:left;
  24.         border-right:1px solid #aeaeae;
  25.     }
  26.     #mainMenu #li2 {
  27.         position:relative; 
  28.         display:block;
  29.         width:130px;
  30.         float:left;
  31.         border-right:1px solid #aeaeae;
  32.     }
May 25 '14 #3
The background-color tag in the #mainmenu should apply to all the li tags after it.
May 25 '14 #4
well it isn't. All I get is white space on all li tags.
May 25 '14 #5
There is some kind of issue with display:block not wanting to show a background color.
May 25 '14 #6
Rabbit
12,516 Expert Mod 8TB
Please use tags when posting code or formatted data.

Where's the rest of the code?
May 25 '14 #7
Here is the navigation div with the menus.. This should give you the idea. The navigation div has a background color.
Expand|Select|Wrap|Line Numbers
  1. <div id="navigation">
  2.     <ul id="mainMenu">     
  3.     <li><a href="firstMenu.html">Home</a></li>
  4.     <li id = "li1"><a href="firstMenu.html" >Services</a>
  5.         <ul id = "ul1">
  6.             <li><a href="firstMenu.html">Service 1</a></li>
  7.             <li><a href="firstMenu.html">Service 2</a></li>
  8.             <li><a href="firstMenu.html">Service 3</a></li>
  9.         </ul>
  10.     </li>
  11.     <li id = "li2"><a href="firstMenu.html">Products</a>
  12.         <ul id = "ul2">
  13.             <li><a href="firstMenu.html">Product 1</a></li>
  14.             <li><a href="firstMenu.html">Product 2</a></li>
  15.             <li><a href="firstMenu.html">Product 3</a></li>
  16.         </ul>
  17.     </li>
  18.     <li><a href="firstMenu.html">Support</a></li>
  19.     <li><a href="firstMenu.html">Blog</a></li>
  20.     <li id = "li3"><a href="firstMenu.html">About</a>
  21.         <ul id = "ul3">
  22.             <li><a href="firstMenu.html">Company History</a></li>
  23.             <li><a href="firstMenu.html">Our Staff</a></li>
  24.             <li><a href="firstMenu.html">Press Releases</a></li>
  25.             <li><a href="firstMenu.html">Investor Information</a></li>
  26.         </ul>
  27.     </li>
  28.     <li><a href="firstMenu.html">Contact</a></li>
  29. </ul>
May 25 '14 #8
I meant to put the closing div tag..just for clarity..

Expand|Select|Wrap|Line Numbers
  1. <div id="navigation">
  2.     <ul id="mainMenu">     
  3.     <li><a href="firstMenu.html">Home</a></li>
  4.     <li id = "li1"><a href="firstMenu.html" >Services</a>
  5.         <ul id = "ul1">
  6.             <li><a href="firstMenu.html">Service 1</a></li>
  7.             <li><a href="firstMenu.html">Service 2</a></li>
  8.             <li><a href="firstMenu.html">Service 3</a></li>
  9.         </ul>
  10.     </li>
  11.     <li id = "li2"><a href="firstMenu.html">Products</a>
  12.         <ul id = "ul2">
  13.             <li><a href="firstMenu.html">Product 1</a></li>
  14.             <li><a href="firstMenu.html">Product 2</a></li>
  15.             <li><a href="firstMenu.html">Product 3</a></li>
  16.         </ul>
  17.     </li>
  18.     <li><a href="firstMenu.html">Support</a></li>
  19.     <li><a href="firstMenu.html">Blog</a></li>
  20.     <li id = "li3"><a href="firstMenu.html">About</a>
  21.         <ul id = "ul3">
  22.             <li><a href="firstMenu.html">Company History</a></li>
  23.             <li><a href="firstMenu.html">Our Staff</a></li>
  24.             <li><a href="firstMenu.html">Press Releases</a></li>
  25.             <li><a href="firstMenu.html">Investor Information</a></li>
  26.         </ul>
  27.     </li>
  28.     <li><a href="firstMenu.html">Contact</a></li>
  29. </ul>
  30. </div>
May 25 '14 #9
URGENT MATTER.. cannot get background color to show up on a display:block. See above for snippets of code in the CSS.. and the code in index.
May 25 '14 #10
PROBLEM FIXED !!

No further help necessary !
May 26 '14 #11
Rabbit
12,516 Expert Mod 8TB
Please post your solution in case someone else runs into the same problem.
May 26 '14 #12
There was an anchor tag with a background attribute set to #fff which was further down. I saw it and here it was:
Expand|Select|Wrap|Line Numbers
  1.     #mainMenu a {
  2.         display:block;
  3.         padding:3px;
  4.         text-decoration:none;
  5.         background-color:#fff;
  6.         color:#009;
  7.     }
  8. I changed it to :
  9.     #mainMenu a {
  10.         display:block;
  11.         padding:3px;
  12.         text-decoration:none;
  13.         background-color:#dfdfdf;
  14.         color:#009;
  15.     }
May 26 '14 #13

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

Similar topics

2
by: Ron | last post by:
Microsoft VBScript runtime error '800a0005' Invalid procedure call or argument: 'left' <% set objFSO = CreateObject("Scripting.FileSystemObject")
3
by: ABC | last post by:
I want click a button and than to popup window which will show my one PDF file. How should I to coding in C#?
8
by: Franky | last post by:
In a prior post I asked about referencing the folder "My Documents" and someone was good enough to tell me about: SHGetFolderPath(NULL, CSIDL_PERSONAL|CSIDL_FLAG_CREATE, NULL, 0, szMyDocPath);...
11
by: briankind | last post by:
Hello i have these radio buttons and i wish to have the corresponding textboxes to be visible when the radiobutton is selected. any Help? snippets. thanks thanks in adv Bry
3
prn
by: prn | last post by:
Hi folks, I'm trying to create letters based on an Access database. I'm using Access 2003 and Word 2003. Most of the data tables are actually on a SQL server and Access is the front end for them....
1
by: deerchao | last post by:
I set ListView.Dock to Top, but how can I get the desired height to avoid it to show vertical scrollbar? I mean is there something like ListView.ClientSize or ListView.VirtualHeight? Thanks!
2
by: vineetbindal | last post by:
Hi all, We have a slide show in a page which shows slids rotating after every 8-10 seconds with some descriptions about them. The problem is if the connection speed is slow then the page loads...
2
by: annaaaa | last post by:
I have to make a database as part of a school assignment. I have a table, with pictures as OLE objects and they pictures show up when i make forms... but i need them to show up in reports but they...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.