473,609 Members | 1,954 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

11 New Member
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 3678
Rabbit
12,516 Recognized Expert Moderator MVP
You need to post your code.
May 25 '14 #2
jeffreycoontz
11 New Member
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
jeffreycoontz
11 New Member
The background-color tag in the #mainmenu should apply to all the li tags after it.
May 25 '14 #4
jeffreycoontz
11 New Member
well it isn't. All I get is white space on all li tags.
May 25 '14 #5
jeffreycoontz
11 New Member
There is some kind of issue with display:block not wanting to show a background color.
May 25 '14 #6
Rabbit
12,516 Recognized Expert Moderator MVP
Please use tags when posting code or formatted data.

Where's the rest of the code?
May 25 '14 #7
jeffreycoontz
11 New Member
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
jeffreycoontz
11 New Member
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
jeffreycoontz
11 New Member
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

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

Similar topics

2
2907
by: Ron | last post by:
Microsoft VBScript runtime error '800a0005' Invalid procedure call or argument: 'left' <% set objFSO = CreateObject("Scripting.FileSystemObject")
3
11162
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
2741
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); But now I think I asked the wrong question. What I want is a folder into which I can put a folder that will show in everyone's MyDocuments.
11
22790
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
2548
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. I have the boilerplate for my letter ready. Now, with Access open and connected to the SQL server, I open Word with the file I want, click "Tools", "Letters and Mailings" and select MailMerge. Word allows me to select the document type, with...
1
2167
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
2133
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 fine but that slide show takes a lot of time to load and (the place we are running the slide show is white blank page till than) I dont understand why. can someone tell me what can we do for this. i have think of something like
2
1408
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 wont? anybody know how i can do this?? thanks in advance!
0
8141
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8585
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8555
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8234
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8408
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7024
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5525
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
1686
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1404
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.