CSS, Most Specific (Help) - html

have small... big problem with my css. I have a couple of values that are becoming more specific than others. Interestingly the selector which is being overridden has !important on more then one of its values. What more can i say here is the CSS
This is what is being overwritten:
div#container div#nav div#specefic ul li ul#sundays li{
width: 211px !important;
}
div#container div#nav div#specefic ul li ul#market li{
width: 161px !important;
}
div#container div#nav div#specefic ul li ul#kids li{
width: 174px !important;
}
div#container div#nav div#speceficul li ul#community li{
width: 193px !important;
}
You can also view an example of this at http://www.letsmine.info/Sundalah
-
#nav {
margin:0;
width:auto;
height:39px;
}
#nav ul {
margin:0;
padding:0;
line-height:30px;
width: 1024px;
height: 39px;
background: url(../index_files/menu.jpg);
position: relative;
}
}
#nav ul li {
margin: 0;
padding: 0;
list-style: none;
position: absolute;
top: 0;
}
#nav ul li, #nav ul li a {
height: 39px;
display: block;
}
#nav li {
margin:0;
padding:0;
list-style:none;
float:left;
position:relative;
}
#nav ul li ul {
background-color: #f2ead5;
margin-top: 8px;
text-align:center;
color:#2a8ac6;
font-family:"Arial";
font-size:19px;
-moz-box-shadow: 3px 3px 3px #cc8930;
-webkit-box-shadow: 3px 3px 3px #cc8930;
box-shadow: 3px 3px 3px #cc8930;
float:none;
opacity: 0.9;
}
body.index #nav ul li.menu1{
width: 118px;
}
body.index #nav ul li.menu1 a:hover{
background: transparent url(../index_files/menu.jpg) 0 0px no-repeat;
}
body.index #nav ul li.menu2 {
left: 119px;
width: 212px;
}
body.index #nav ul li.menu2 a:hover{
background: transparent url(../index_files/menu.jpg) 119px 0px no-repeat;
}
body.index #nav ul li.menu3 {
left: 332px;
width: 161px;
}
body.index #nav ul li.menu3 a:hover{
background: transparent url(../index_files/menu.jpg) 332px 0px no-repeat;
}
body.index #nav ul li.menu4 {
left: 494px;
width: 174px;
}
body.index #nav ul li.menu4 a:hover{
background: transparent url(../index_files/menu.jpg) 494px 0px no-repeat;
}
body.index #nav ul li.menu5 {
left: 669px;
width: 193px;
}
body.index #nav ul li.menu5 a:hover{
background: transparent url(../index_files/menu.jpg) 669px 0px no-repeat;
}
body.index #nav ul li.menu6 {
left: 863px;
width: 166px;
}
body.index #nav ul li.menu6 a:hover{
background: transparent url(../index_files/menu.jpg) 863px 0px no-repeat;
}
body.community #nav ul li ul {
background-color: #aeceab;
}
body.kids #container #nav ul li ul {
background-color: #89bab7;
opacity: 0.8;
}
body.market #nav ul li ul {
background-color: #ffd0ce;
}
body.sundays #nav ul li ul {
background-color: #E7DAB2;
}
body.index #nav ul li ul {
background-color: #E7DAB2;
}
body.contacts #nav ul li ul {
background-color: #E7DAB2;
}
#nav ul li ul li a:link{
text-decoration: none;
}
div#container div#nav div#specefic ul li ul#sundays li{
width: 211px !important;
}
div#container div#nav div#specefic ul li ul#market li{
width: 161px !important;
}
div#container div#nav div#specefic ul li ul#kids li{
width: 174px !important;
}
div#container div#nav div#speceficul li ul#community li{
width: 193px !important;
}
/*********************************************/
/* hide menu and allow it to return */
/*********************************************/
#nav ul ul {
position:absolute;
visibility:hidden;
top:30px;
}
#nav ul li:hover ul {
visibility:visible;
z-index:9999;
}
/**********************************************/
/*sets top level hover color*/
#nav li:hover {
opacity: 1;
}
/*sets link items hover color and background*/
#nav ul li:hover ul li a:hover {
opacity: 1;
}
/* Contains the Float */
.clearFloat {
clear:both;
margin:0;
padding:0;
}
/* IE7 Display Fix */
#nav #holder ul li {
display: inline;
}

Your CSS is in a real mess I removed some of unnecessary things from there which caused the issues.
your drop.css:
#nav {
height: 39px;
margin: 0;
width: auto;
}
.mainmenu {
background: url("../index_files/menu.jpg") repeat scroll 0 0 transparent;
height: 39px;
line-height: 30px;
margin: 0;
padding: 0;
position: relative;
width: 1024px;
}
#nav ul li, #nav ul li a {
display: block;
height: 39px;
}
#nav li {
float: left;
list-style: none outside none;
margin: 0;
padding: 0;
position: relative;
}
#nav ul li ul {
background-color: #F2EAD5;
box-shadow: 3px 3px 3px #CC8930;
color: #2A8AC6;
float: none;
font-family: "Arial";
font-size: 19px;
margin-top: 8px;
opacity: 0.9;
text-align: center;
}
body.index #nav ul li.menu1 {
width: 118px;
}
body.index #nav ul li.menu2 {
width: 212px;
}
body.index #nav ul li.menu3 {
width: 161px;
}
body.index #nav ul li.menu4 {
width: 174px;
}
body.index #nav ul li.menu5 {
width: 193px;
}
body.index #nav ul li.menu6 {
width: 166px;
}
body.community #nav ul li ul {
background-color: #AECEAB;
}
body.kids #container #nav ul li ul {
background-color: #89BAB7;
opacity: 0.8;
}
body.market #nav ul li ul {
background-color: #FFD0CE;
}
body.sundays #nav ul li ul {
background-color: #E7DAB2;
}
body.index #nav ul li ul {
background-color: #E7DAB2;
}
body.contacts #nav ul li ul {
background-color: #E7DAB2;
}
#nav ul li ul li a:link {
text-decoration: none;
}
div#container div#nav div#specefic ul li ul#sundays li {
width: 211px !important;
}
div#container div#nav div#specefic ul li ul#market li {
width: 161px !important;
}
div#container div#nav div#specefic ul li ul#kids li {
width: 174px !important;
}
div#container div#nav div#speceficul li ul#community li {
width: 193px !important;
}
#nav ul ul {
position: absolute;
top: 30px;
visibility: hidden;
}
#nav ul li:hover ul {
visibility: visible;
z-index: 9999;
}
#nav li:hover {
opacity: 1;
}
#nav ul li:hover ul li a:hover {
opacity: 1;
}
.clearFloat {
clear: both;
margin: 0;
padding: 0;
}
#nav #holder ul li {
display: inline;
}
also in your html change the first to thats the class which I added so it doesn't clash with the sub menu (thats why you could see the menu image in there).
Hope it helps
EXAMPLE 2
to use images in , don't put any image in and use this code... NB! this is only a sample!
.menu1 {
background-position: 0 0;
}
.menu2 {
background-position: 0 -16px;
}
.menu3 {
background-position: 0 -32px;
}
.menu4 {
background-position: 0 -49px;
}
.menu5 {
background-position: 0 -64px;
}
.menu, .menu2, .menu3, .menu4, .menu5 {
background-image: url("images/menuiconset.png");
background-repeat: no-repeat;
height: 16px;
width: 180px;
}
if all buttons are the same size .. put height and width in .menuX if buttons are different size

Related

Center navigation Menu in wordpress

I'm working on old Wordpress page created with myMag theme, and I need to centralize menu bar, I'm pretty new to CSS and looking for various solutions I cant find any solutions for my case.
the CSS file looks like this:
#navcontainer #navbar {
float: left;
height: 51px;
line-height: 50px;
margin-left: -15px;
margin-top: 1px;
}
margin:0;
padding:0;
width:900px;
list-style-type:none;
display:table;
position:relative;
line-height:50px;
z-index:5;
ul {
text-align: justify
}
li {
display: inline-block
}
#navcontainer #navbar a {
height: 40px;
display: block;
padding: 0 21px;
text-decoration: none;
text-align: center;
line-height: 28px;
outline: none;
float: left;
z-index: 35;
position: relative;
color: #FFF;
text-shadow: 1px 1px 0 #515151;
font-weight: bold;
}
#navcontainer #navbar a:hover {
color: #CCC;
}
#navcontainer #navbar ul a {
line-height: 30px;
}
#navcontainer #navbar li {
float: left;
position: relative;
z-index: 20;
margin-top: 10px;
}
#navcontainer #navbar li li {
border-left: none;
margin-top: 0;
}
#navcontainer #navbar ul {
position: absolute;
display: none;
width: 172px;
top: 38px;
left: -1px;
background: #f5f5f5;
}
#navcontainer #navbar li ul a {
width: 130px;
height: auto;
float: left;
text-align: left;
padding: 0 21px;
color: #606060;
text-shadow: none;
}
#navcontainer #navbar ul ul {
top: auto;
}
#navcontainer #navbar li ul ul {
left: 172px;
top: 0px;
}
#navcontainer #navbar li ul ul a {
border-left: 1px solid #CCC;
}
#navcontainer #navbar ul {
border-top: none;
}
#navcontainer #navbar ul a,
#navcontainer #navbar ul li {
background-color: #e7e7e7;
}
#navcontainer #navbar ul a:hover,
#navcontainer #navbar ul a:focus {
color: #18649a;
}
#navcontainer #navbar li:hover ul ul,
#navcontainer #navbar li:hover ul ul ul,
#navcontainer #navbar li:hover ul ul ul ul {
display: none;
}
#navcontainer #navbar li:hover ul,
#navcontainer #navbar li li:hover ul,
#navcontainer #navbar li li li:hover ul,
#navcontainer #navbar li li li li:hover ul {
display: block;
}
php that creates menu looks like this:
<div id="navcontainer">
<div class="navigation">
<div class="wrapper">
<ul id="navbar">
<?php $exclude = $myOptions['pages_excl'];?>
<?php if(!$myOptions['pages_limit']) {
$limit = '10'; } else {
$limit = $myOptions['pages_limit'];
}
if($myOptions['pages_limit'] == '0') {
$limit = 0;
}
?>
<li>Home</li>
<?php wp_list_pages("exclude=$exclude&title_li=&depth=3&number=$limit"); ?>
</ul>
</div>
</div>
</div>
You need to give the #navbar a fixed width and change the margin as following:
#navcontainer #navbar {
width: 600px; // change this to a width that suits your menu
height: 51px;
line-height:50px;
margin-left: auto;
margin-right: auto;
margin-top: 1px;
}
margin-left:auto; and margin-right: auto; center the navigation, this can only be done if the navigation has a fixed width. So you will need to adjust the fixed width when you change the number of items in the navigation.

Web Navigation Bar Will Not Center

Trying to get the words in my navigation bar to center. I have tried a bunch of different configs that I found online and so far no luck.
Also, is there anything I can do to make the navigation bar appear cleaner and more professional?
Thank you in advance
<div class="nav-container clearfix">
<ul id="nav">
<li class="first"><span>Home</li>
<li><span>Why Soy?</li>
<li><span>Candle Sold, Tree Planted</li>
<li><span>Build-a-Candle</li>
<li><span>Contact Us</li>
<li><a class="category" href="<?php echo Mage::getBaseUrl(); ?>all-products">
<span>Buy Products</span>
<ul class="level0">
<?php echo $_menu ?>
</ul>
</a>
</li>
</ul>
/*** CLEARFIX ******/
.clearfix:before,
.clearfix:after {
content: "";
display: table;
clear: both
}
/********** < Navigation */
.nav-container {clear: both; width:100%; float: left; text-align: center; margin: 10px 0px 10px; text-transform: uppercase; font-weight: bold; display: inline; background:#d4dadd !important; box-shadow: 10px 10px 5px #888888 !important; }
#nav { margin:0 auto; padding:0; font-size:12px; }
/* All Levels */ /* Style consistent throughout all nav levels */
#nav li {
display: inline-block;
padding: 5px;
margin: 5px;
border-right: 1px solid #000;
list-style: none;
vertical-align: top;
height: 50px;
position:relative;
}
#nav li.over { z-index:998; background-color: #b3bec3; }
#nav a,
#nav a:hover { display:block; line-height:1.3em; text-decoration:none; padding: 10px;
text-align: center; }
#nav span { display:block; cursor:pointer; }
#nav li ul span {white-space:normal; }
#nav ul li.parent a {}
#nav ul li.parent li a { background-image:none; }
#nav a.category span { background: url(../images/nav-category.gif) no-repeat center right; padding-right: 20px; }
/* 0 Level */
#nav li.active a { color:#2882ce; }
#nav a { font-size: 115%; color:#303030; }
#nav li.last a { padding-right: 0px !important;}
#nav li.over a,
#nav a:hover { color:#2882ce; }
/* 1st Level */
#nav ul li,
#nav ul li.active { float:none; margin:0; padding-bottom:1px; background:#d4dadd; }
#nav ul li.last { background:#d4dadd; padding-bottom:0; }
#nav ul a,
#nav ul a:hover { float:none; padding:0; background:none; }
#nav ul li a { font-size: 100% !important; font-weight:normal !important; }
/* 2nd Level */
#nav ul,
#nav div { position:absolute; width:15em; top:27px; left:-10000px; border:1px solid #899ba5; }
#nav div ul { position:static; width:auto; border:none; }
/* 3rd+ Level */
#nav ul ul,
#nav ul div { top:5px; }
#nav ul li a { background:#d4dadd; }
#nav ul li a:hover { background:#b3bec3; }
#nav ul li a,
#nav ul li a:hover { color:#2f2f2f !important; }
#nav ul span,
#nav ul li.last li span { padding:3px 15px 4px 15px; }
/* Show menu */
#nav li ul.shown-sub,
#nav li div.shown-sub { left:0; z-index:999; }
#nav li .shown-sub ul.shown-sub,
#nav li .shown-sub li div.shown-sub { left:100px; }
<div class="nav-container clearfix">
<ul id="nav">
<li class="first"><span>Home</li>
<li><span>Why Soy?</li>
<li><span>Candle Sold, Tree Planted</li>
<li><span>Build-a-Candle</li>
<li><span>Contact Us</li>
<li><a class="category" href="<?php echo Mage::getBaseUrl(); ?>all-products">
<span>Buy Products</span>
<ul class="level0">
<?php echo $_menu ?>
</ul>
</a>
</li>
</ul>
I changed your code a bit, here is a snippet below, to see this snippet working click Full Page button.
UPDATED snippet based on OP's Comments to answer.
/*** CLEARFIX ******/
.clearfix:before,
.clearfix:after {
content: "";
display: table;
clear: both
}
/********** < Navigation */
.nav-container {
clear: both;
width: 100%;
float: left;
margin: 10px 0px 10px;
text-transform: uppercase;
font-weight: bold;
display: inline;
background: #ecf3f6 !important;
box-shadow: 10px 10px 5px #888888 !important;
}
#nav {
margin: 0 auto;
padding: 0;
font-size: 12px;
}
/* All Levels */
/* Style consistent throughout all nav levels */
#nav li {
display: inline-block;
margin: 5px 0;
border-right: 1px solid #000;
list-style: none;
vertical-align: top;
height: 70px;
width:16.3%
}
#nav li:last-child {
border-right: 0
}
#nav li.over {
z-index: 998;
background-color: #d4dadd;
}
#nav a,
#nav a:hover {
display: block;
line-height: 1.3em;
text-decoration: none;
padding: 10px;
text-align: center
}
#nav span {
display: block;
cursor: pointer
}
#nav li ul span {
white-space: normal;
}
#nav ul li.parent a {} #nav ul li.parent li a {
background-image: none;
}
#nav a.category span {
background: url(../images/nav-category.gif) no-repeat center right;
padding-right: 20px;
}
/* 0 Level */
#nav li.active a {
color: #2882ce;
}
#nav a {
font-size: 115%;
color: #303030;
}
#nav li.last a {
padding-right: 0px !important;
}
#nav li.over a,
#nav a:hover {
color: #2882ce;
}
/* 1st Level */
#nav ul li,
#nav ul li.active {
float: none;
margin: 0;
padding-bottom: 1px;
background: #ecf3f6;
}
#nav ul li.last {
background: #ecf3f6;
padding-bottom: 0;
}
#nav ul a,
#nav ul a:hover {
float: none;
padding: 0;
background: none;
}
#nav ul li a {
font-size: 100% !important;
font-weight: normal !important;
}
/* 2nd Level */
#nav ul,
#nav div {
position: absolute;
width: 15em;
top: 27px;
left: -10000px;
border: 1px solid #899ba5;
}
#nav div ul {
position: static;
width: auto;
border: none;
}
/* 3rd+ Level */
#nav ul ul,
#nav ul div {
top: 5px;
}
#nav ul li a {
background: #ecf3f6;
}
#nav ul li a:hover {
background: #d5e4eb;
}
#nav ul li a,
#nav ul li a:hover {
color: #2f2f2f !important;
}
#nav ul span,
#nav ul li.last li span {
padding: 3px 15px 4px 15px;
}
/* Show menu */
#nav li ul.shown-sub,
#nav li div.shown-sub {
left: 0;
z-index: 999;
}
#nav li .shown-sub ul.shown-sub,
#nav li .shown-sub li div.shown-sub {
left: 100px;
}
<div class="nav-container clearfix">
<ul id="nav">
<li class="first"><span>Home</span>
</li>
<li>whysoy<span>Why Soy?</span>
</li>
<li>plantatree<span>Candle Sold, Tree Planted</span>
</li>
<li><span>Build-a-Candle</span>
</li>
<li><span>Contact Us</span>
</li>
<li><a class="category" href=""><span>Buy Products</span>
<ul class="level0">
</ul>
</a>
</li>
</ul>
</div>
UPDATE #3 (with new info from OP)
in order to achieve what you want, just make this changes below on your CSS:
.nav-container {
background: none repeat scroll 0 0 #d4dadd !important;
box-shadow: 10px 10px 5px #888888 !important;
float: left;
font-size: 0;
font-weight: bold;
margin: 10px 0;
text-align: center;
text-transform: uppercase;
width: 100%;
}
#nav li {
border-right: 1px solid #000;
display: inline-block;
font-size: 12px;
height: 50px;
list-style: none outside none;
margin: 5px 0;
padding: 5px;
position: relative;
vertical-align: top;
width: 15%;
}
#nav ul li, #nav ul li.active {
background: none repeat scroll 0 0 #d4dadd;
border-right: 0 none;
display: block;
float: none;
margin: 0;
width: 100%;
}
/*you may delete this:
#nav ul li.last {
}*/

css submenu ul li problems

I have a menu using SuperFish but the last 2 submenu's do not align up properly.
Here is my jsfiddle: http://jsfiddle.net/uP4bY/4/
My CSS looks like this:
/* Header/Navigation */
div#Nav {
background:transparent url(../Images/nav_Bg.png) no-repeat scroll top left;
height:70px;
width:980px;
margin:0 auto;
display:block;
position:relative;
z-index:2;
}
/*Level 1 or Parent / Destination*/
div#Nav ul {
padding-top:9px;
display:inline;
list-style-type:none;
margin:0;
}
div#Nav ul li {
background:transparent url(../Images/nav_li_Separator.png) no-repeat scroll center left;
padding-left:8px;
margin-left:8px;
display:inline;
position:relative;
}
div#Nav ul li.First {
background:none;
margin:0;
padding:0;
}
/*Level 2 Treks*/
div#Nav ul li ul {
left:10px;
position:absolute;
top:26px;
padding:0 !important;
z-index:100;
height:500px;
float:left;
list-style:outside;
width:auto;
}
/*Level 3 Everest Region*/
div#Nav ul li ul li ul {
float: left;
height: 500px;
left: 50px;
list-style: disc outside none;
padding: 0 !important;
position: absolute;
top: 30px;
width: auto;
z-index: 100;
}
/*Level 5 Everest Base Camp*/
div#Nav ul ul ul ul ul {
float: left;
height: 500px;
left: 50px;
list-style: disc outside none;
padding: 0 !important;
position: absolute;
top: 60px;
width: auto;
z-index: 100;
}
div#Nav ul li ul li {
border-top:1px solid #2f3b48;
border-right:1px solid #384857;
border-bottom:1px solid #384857;
height:24px;
display:block;
padding:5px 15px 0;
width:150px;
/*width:150px;*/
border-left:1px solid #384857;
margin:0 !important;
background:transparent url(http://www.kenticotemplates.net/themeforest/DreamTravel/Images/Nav_ul_li_Bg.png) repeat scroll top left !important;
}
div#Nav a, div#Nav a:link, div#Nav a:visited {
color:#7f8b98;
}
div#Nav a:hover, div#Nav a.selected {
color:#96b2cb !important;
text-decoration:none;
}
div#Nav ul#Links, div#Nav ul.nav {
float:left;
text-transform:uppercase;
}
div#Nav ul.Lang {
float:right;
}
div#Nav ul li {
float:left;
}
I am pretty certain i need to style the last ul li but when i do this it moves the previous ul li.
UPDATE: it should look like this minus the white space!
http://i48.tinypic.com/1zfpxqf.png
Solution of problem is her in fiddle : http://jsfiddle.net/7mvuw/
Demo: http://jsfiddle.net/7mvuw/embedded/result/
Note: I have changed the looks and feel but html structure is same, looks and feel for demo purpose you can adjust as per your requirement.
#access {
background: #000;
display: block;
float: left;
margin: 0 auto;
width: 940px;
}
#access .menu-header,
div.menu {
font-size: 13px;
margin-left: 12px;
width: 928px;
}
#access .menu-header ul,
div.menu ul {
list-style: none;
margin: 0;
}
#access .menu-header li,
div.menu li {
float: left;
position: relative;
}
#access a {
color: #aaa;
display: block;
line-height: 38px;
padding: 0 10px;
text-decoration: none;
}
#access ul ul {
box-shadow: 0px 3px 3px rgba(0,0,0,0.2);
-moz-box-shadow: 0px 3px 3px rgba(0,0,0,0.2);
-webkit-box-shadow: 0px 3px 3px rgba(0,0,0,0.2);
display: none;
position: absolute;
top: 38px;
left: 0;
float: left;
width: 180px;
z-index: 99999;
padding-left:0;
}
#access ul ul li {
min-width: 180px;
}
#access ul ul ul {
left: 100%;
top: 0;
}
#access ul ul a {
background: #333;
line-height: 1em;
padding: 10px;
width: 160px;
height: auto;
}
#access li:hover > a,
#access ul ul :hover > a {
background: #333;
color: #fff;
}
#access ul li:hover > ul {
display: block;
}
#access ul li.current_page_item > a,
#access ul li.current-menu-ancestor > a,
#access ul li.current-menu-item > a,
#access ul li.current-menu-parent > a {
color: #fff;
}

Small CSS error, (Need a second opinion)

I have looked long and hard for the error in my CSS. I can't find it, I am sure it is something obvious, I just cant figure out what it is! The problem is i have a element. #nav li ul, that has a left margin that shouldn't exist. setting it's margin: 0px; doesn't work. Here is the CSS code and the html is located at http://www.letsmine.info/Sundalah. The #nav is the menu, I have only worked on the index, so don't bother browsing the other pages.
#nav {
height: 39px;
margin: 0;
width: auto;
}
.mainmenu {
background: url("../index_files/menu.jpg") repeat scroll 0 0 transparent;
height: 39px;
line-height: 30px;
margin: 0;
padding: 0;
position: relative;
width: 1024px;
}
#nav li, #nav li a {
display: block;
height: 39px;
}
#nav li {
float: left;
list-style: none outside none;
margin: 0;
padding: 0;
position: relative;
}
#nav li ul {
background-color: #F2EAD5;
box-shadow: 3px 3px 3px #CC8930;
color: #2A8AC6;
float: none;
font-family: "Arial";
font-size: 19px;
margin-top: 8px;
opacity: 0.9;
text-align: center;
}
body.index #nav li.menu1 {
width: 118px;
}
body.index #nav li.menu1:hover {
width: 118px;
}
body.index #nav li.menu2 {
width: 212px;
}
body.index #nav li.menu3 {
width: 161px;
}
body.index #nav li.menu4 {
width: 174px;
}
body.index #nav li.menu5 {
width: 193px;
}
body.index #nav li.menu6 {
width: 166px;
}
body.community #nav li ul {
background-color: #AECEAB;
}
body.kids #container #nav li ul {
background-color: #89BAB7;
opacity: 0.8;
}
body.market #nav li ul {
background-color: #FFD0CE;
}
body.sundays #nav li ul {
background-color: #E7DAB2;
}
body.index #nav li ul {
background-color: #E7DAB2;
}
body.contacts #nav li ul {
background-color: #E7DAB2;
}
#nav li ul li a:link {
text-decoration: none;
}
div#container div#nav li ul#sundays li {
width: 211px;
}
div#container div#nav li ul#market li {
width: 161px;
}
div#container div#nav li ul#kids li {
width: 174px;
}
div#container div#nav li ul#community li {
width: 193px;
}
#nav ul {
position: absolute;
top: 30px;
visibility: hidden;
}
#nav li:hover ul {
visibility: visible;
z-index: 9999;
}
#nav li:hover {
opacity: 1;
}
#nav li:hover ul li a:hover {
opacity: 1;
}
.clearFloat {
clear: both;
margin: 0;
padding: 0;
}
#nav #holder ul li {
display: inline;
}
Assuming that you're talking about this page:
http://www.letsmine.info/Sundalah/
(I found a highly likely link on a previous question of yours)
The reason that margin: 0 is not working is because it's not margin - it's padding. This will fix it:
#nav li ul {
padding: 0
}

CSS, Hover error (Second Opinion)

looks like i have had a long day, bit tired and can't think. Anyway i have a problem in my css, i recently just fixed one error, then added css sprites and implemented it into my menu. The problem is that the hover state of my main menu is being imprinted onto my sub menus.
So body.currentpage #container #nav .mainmenu li ul li, is having a background image put on it from body.currentpage #nav li#menu6 a:hover. The html is located at, http://www.letsmine.info/Sundalah. Here is the CSS
#nav {
height: 39px;
margin: 0;
width: auto;
margin-bottom: -8px;
}
.mainmenu {
background: url("../index_files/menu.jpg") repeat scroll 0 0 transparent;
height: 39px;
line-height: 30px;
margin: 0;
padding: 0;
position: relative;
width: 1024px;
}
#nav li, #nav li a {
display: block;
height: 39px;
}
#nav li {
float: left;
list-style: none outside none;
margin: 0;
padding: 0;
position: absolute;
top: 0;
}
#nav li ul {
background-color: #F2EAD5;
box-shadow: 3px 3px 3px #CC8930;
color: #2A8AC6;
float: none;
font-family: "Arial";
font-size: 19px;
margin-top: 8px;
opacity: 0.9;
text-align: center;
padding: 0px;
}
body #nav li#menu1 {
left: 0;
width: 118px;
}
body #nav li#menu2 {
left: 119px;
width: 212px;
}
body #nav li#menu3 {
left: 332px;
width: 161px;
}
body #nav li#menu4 {
left: 494px;
width: 174px;
}
body #nav li#menu5 {
left: 664px;
width: 193px;
}
body #nav li#menu6 {
left: 861px;
width: 166px;
}
body.index #nav li#menu1 a:hover{
background: transparent url(../index_files/menu.jpg) 0 -39px no-repeat;
}
body.index #nav li#menu2 a:hover{
background: transparent url(../index_files/menu.jpg) -119px -39px no-repeat;
}
body.index #nav li#menu3 a:hover{
background: transparent url(../index_files/menu.jpg) -332px -39px no-repeat;
}
body.index #nav li#menu4 a:hover{
background: transparent url(../index_files/menu.jpg) -494px -39px no-repeat;
}
body.index #nav li#menu5 a:hover{
background: transparent url(../index_files/menu.jpg) -664px -39px no-repeat;
}
body.index #nav li#menu6 a:hover{
background: transparent url(../index_files/menu.jpg) -861px -39px no-repeat;
}
body.community #container #nav li ul {
background-color: #AECEAB;
}
body.kids #container #nav li ul {
background-color: #89BAB7;
opacity: 0.8;
}
body.market #container #nav li ul {
background-color: #FFD0CE;
}
body.sundays #container #nav li ul {
background-color: #E7DAB2;
}
body.index #container #nav li ul {
background-color: #E7DAB2;
}
body.contacts #container #nav li ul {
background-color: #E7DAB2;
}
#nav li ul li a:link {
text-decoration: none;
}
div#container div#nav li ul#sundays li {
width: 211px;
}
div#container div#nav li ul#market li {
width: 161px;
}
div#container div#nav li ul#kids li {
width: 174px;
}
div#container div#nav li ul#community li {
width: 193px;
}
#nav ul {
position: absolute;
top: 30px;
visibility: hidden;
}
#nav li:hover ul {
visibility: visible;
z-index: 9999;
}
#nav li:hover {
opacity: 1;
}
#nav li:hover ul li a:hover {
opacity: 1;
}
.clearFloat {
clear: both;
margin: 0;
padding: 0;
}
#nav #holder ul li {
display: inline;
}
You can fix this one by changing the selector in this :
body.index #nav li#menu2 a:hover {
background: transparent url(../index_files/menu.jpg) -119px -39px no-repeat;
}
to this:
body.index #nav li#menu2 > a:hover
This way, only a elements that are direct children of li#menu2 will have the background applied.
You'll have to do the same > trick to each of the 6 similar rules.
You can fix the "stuffed text" with the same idea.
Change this selector:
#nav li
to this:
#nav > li