CSS: Dropdown menu not displaying - css

I have this website: http://dev.gratefulhearttherapy.org/
with a dropdown menu, it's supposed to unfold when you hover a category like "Our Services" or "Abous Us". But it doesn't.
I know it's a CSS issue because I use 2 different stylesheets, and one works while the other doesn't. However I've spent two hours on it and I don't find what's wrong.
I tried to play with z-index but it doesn't work. I took over someone else's work and CSS file is messy, and the website calls several stylesheets. In any case, the stylesheet I'm working with is here: http://dev.gratefulhearttherapy.org/index.php/tools/css/themes/gratefulheart/typography-new2.css
The relevant part of the CSS begins line 287, the "Mega Menu" section. Here it is:
Can anyone give me a tip at what might be the issue?
/* Mega Menu */
.top-level-nav a.nav-path-selected {
color: #EA5603 !important;
ul.mega-menu {
height: 44px;
width: 96%;
text-align: left;
margin: 10px 0 0 20px;
padding: 0 60px;
text-indent: 0;
list-style-type: none;
margin-left: -1px;
}
ul li.mega-menu {
padding: 0;
margin: 0;
text-indent: 0;
display: inline;
line-height: 44px;
}
ul li a.mega-menu {
text-decoration: none;
color: #DE573C;
font-size: 138.5%;
}
.nav li a:hover {
color: #8e4c0f;
}
.custom {line-height: 1.6;}
.custom ul.mega-menu, .custom ul.mega-menu, .custom ul.mega-menu li {margin: 0; padding: 0; border: none;}
.custom ul.mega-menu {
background: #D6CEB4;
width: 100%;
height: 44px;
border-top: solid 2px #CCC2A5;
border-bottom: solid 2px #CCC2A5;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;; position: relative;
}
.custom ul.mega-menu li {float: left; margin: 0; padding: 0; }
.custom ul.mega-menu li a {float: left; display: block; padding: 12px 38px 12px 25px; ; text-decoration: none; color: #3B3B3B; font-size: 138.5%; text-decoration: none;}
.custom ul.mega-menu li a.dc-mega {position: relative;}
.custom ul.mega-menu li a .dc-mega-icon {display: block; position: absolute; top: 18px; right: 15px; width: 8px; height: 6px; background: url(images/arrow.png) no-repeat 0 0;}
.custom ul.mega-menu li.mega-hover a, .custom ul.mega-menu li a:hover {background-position: 100% -40px; color: #8e4c0f;}
.custom ul.mega-menu li.mega-hover a .dc-mega-icon {background-position: 0 100%;}
.custom ul.mega-menu li .sub-container { /* block container of dropdown submenu when it's closed (I think) */
position: absolute;
background: url(images/bg_sub_left.png) no-repeat 0 100%;
padding: 10px 10px 0 10px;
margin-left: -3px;
}
.custom ul.mega-menu li .sub { /* dropdown submenu itself */
margin: -8px 0 0 -8px;
background: #E3DDD3
url(images/bg_sub.png) no-repeat 100% 100%;
padding: 00px 20px 20px 10px;
border: 1px #D1C6B4;
border-style: none solid solid solid;
/* rounded corners */
-webkit-border-bottom-right-radius: 3px;
-webkit-border-bottom-left-radius: 3px;
-moz-border-radius-bottomright: 3px;
-moz-border-radius-bottomleft: 3px;
border-bottom-right-radius: 3px;
border-bottom-left-radius: 3px;
/* dropshadow effect */
-webkit-box-shadow: 0px 4px 6px rgba(50, 50, 50, 0.6);
-moz-box-shadow: 0px 4px 6px rgba(50, 50, 50, 0.6);
box-shadow: 0px 4px 6px rgba(50, 50, 50, 0.6);
}
.custom ul.mega-menu li .sub-container.mega .sub {padding: 20px 20px 10px 0;}
.custom ul.mega-menu li .sub .row {width: 100%; overflow: hidden; clear: both;}
.custom ul.mega-menu li .sub li {list-style: none; float: none; width: 170px; font-size: 120%; line-height: 2;} /* li of dropdown submenu */
.custom ul.mega-menu li .sub li.mega-hdr {margin: 0 10px 10px 0; float: left;}
.custom ul.mega-menu li .sub li.mega-hdr.last {margin-right: 0;}
.custom ul.mega-menu li .sub a, .custom ul.mega-menu li .sub span {background: none; border: none; text-shadow: none; color: #111; padding: 7px 10px; display: block; float: none; text-decoration: none; font-size: 0.9em;}
.custom ul.mega-menu li .sub li.mega-hdr .mega-hdr-a {padding: 5px 5px 5px 15px; margin-bottom: 5px; background: #6B6B6B url(images/bg_mega_hdr.png) no-repeat 0 0; text-transform: uppercase; font-weight: bold; color: #fff; text-shadow: 1px 1px 1px #333;}
.custom ul.mega-menu li .sub li.mega-hdr a.mega-hdr-a:hover {color: #000; text-shadow: none;}
.custom ul.mega-menu .sub li.mega-hdr li a {padding: 4px 5px 4px 20px; background: url(images/arrow_off.png) no-repeat 5px 8px; font-weight: normal;}
.custom ul.mega-menu .sub li.mega-hdr li a:hover {color: #a32403; background: #efefef url(images/arrow_on.png) no-repeat 5px 8px;}
.custom ul.mega-menu .sub ul li {padding-right: 0;}
.custom ul.mega-menu li .sub-container.non-mega .sub {padding: 20px 20px 20px 0;}
.custom ul.mega-menu li .sub-container.non-mega li {padding: 0; width: 190px; margin: 0;}
.custom ul.mega-menu li .sub-container.non-mega li a {padding: 7px 5px 7px 22px; background: url(images/arrow_off.png) no-repeat 7px 10px;}
.custom ul.mega-menu li .sub-container.non-mega li a:hover {color: #a32403; background: #efefef url(images/arrow_on.png) no-repeat 7px 10px;}

It's because your #headerNav is set to overflow:hidden. Just remove this line of css:
#headerNav {
…
overflow: hidden;
…
}

Related

Major CSS issue; text should be white, not blue. CSS selector issue, or !important issue?

CSS issue. This is a WordPress site and the text in my menu items should be white. But for some odd reason, it's showing up as blue:
So I firebugged it, and I really don't know what to add as custom CSS with all the selectors #, ., etc.; I've always had trouble with this:
Lastly, here's my CSS that's supposed to be used ..
#dc_jqmegamenu_widget-%ID%-item {font: normal 13px Arial, sans-serif; line-height: 16px;}
#dc_jqmegamenu_widget-%ID%-item ul, #dc_jqmegamenu_widget-%ID%-item ul, #dc_jqmegamenu_widget-%ID%-item ul li {margin: 0; padding: 0; border: none;}
#dc_jqmegamenu_widget-%ID%-item ul.menu {background: #222 url(skins/images/bg_black.png) repeat-x 0 -80px; width: 100%; height: 40px; border-right: 1px solid #1B1B1B; border-left: 1px solid #1B1B1B; position: relative;}
#dc_jqmegamenu_widget-%ID%-item ul li {float: left; margin: 0; padding: 0; font-size: 13px; font-weight: bold;}
#dc_jqmegamenu_widget-%ID%-item ul li a {float: left; display: block; color: #fff; padding: 12px 38px 12px 25px; background: url(skins/images/bg_black.png) repeat-x 100% 0; text-shadow: 1px 1px 1px #000; text-decoration: none;}
#dc_jqmegamenu_widget-%ID%-item ul li a.dc-mega {position: relative;}
#dc_jqmegamenu_widget-%ID%-item ul li a .dc-mega-icon {display: block; position: absolute; top: 18px; right: 15px; width: 8px; height: 6px; background: url(skins/images/arrow.png) no-repeat 0 0;}
#dc_jqmegamenu_widget-%ID%-item ul li.mega-hover a, #dc_jqmegamenu_widget-%ID%-item ul li a:hover {background-position: 100% -40px; color: #000; text-shadow: none;}
#dc_jqmegamenu_widget-%ID%-item ul li.mega-hover a .dc-mega-icon {background-position: 0 100%;}
#dc_jqmegamenu_widget-%ID%-item ul li .sub-container {position: absolute; background: url(skins/images/bg_sub_left.png) no-repeat 0 100%; padding-left: 20px; margin-left: -3px;}
#dc_jqmegamenu_widget-%ID%-item ul li .sub {background: url(skins/images/bg_sub.png) no-repeat 100% 100%; padding: 20px 20px 20px 10px;}
#dc_jqmegamenu_widget-%ID%-item ul li .sub-container.mega .sub {padding: 20px 20px 10px 0;}
#dc_jqmegamenu_widget-%ID%-item ul.full-width li .sub-container.mega .sub {margin-right: -2px;}
#dc_jqmegamenu_widget-%ID%-item ul li .sub .row {width: 100%; overflow: hidden; clear: both;}
#dc_jqmegamenu_widget-%ID%-item ul li .sub li {list-style: none; float: none; width: 170px; font-size: 1em; font-weight: normal;}
#dc_jqmegamenu_widget-%ID%-item ul li .sub li.mega-hdr {margin: 0 10px 10px 0; float: left;}
#dc_jqmegamenu_widget-%ID%-item ul li .sub li.mega-hdr.last {margin-right: 0;}
#dc_jqmegamenu_widget-%ID%-item ul li .sub a {background: none; border: none; text-shadow: none; color: #111; padding: 7px 10px; display: block; float: none; text-decoration: none; font-size: 0.9em;}
#dc_jqmegamenu_widget-%ID%-item ul li .sub li.mega-hdr a.mega-hdr-a {padding: 5px 5px 5px 15px; margin-bottom: 5px; background: #6B6B6B url(skins/images/bg_mega_hdr.png) no-repeat 0 0; text-transform: uppercase; font-weight: bold; color: #fff; text-shadow: 1px 1px 1px #333;}
#dc_jqmegamenu_widget-%ID%-item ul li .sub li.mega-hdr a.mega-hdr-a:hover {color: #000; text-shadow: none;}
#dc_jqmegamenu_widget-%ID%-item ul .sub li.mega-hdr li a {padding: 4px 5px 4px 20px; background: url(skins/images/arrow_off.png) no-repeat 5px 8px; font-weight: normal;}
#dc_jqmegamenu_widget-%ID%-item ul .sub li.mega-hdr li a:hover {color: #a32403; background: #efefef url(skins/images/arrow_on.png) no-repeat 5px 8px;}
#dc_jqmegamenu_widget-%ID%-item ul .sub ul li {padding-right: 0;}
#dc_jqmegamenu_widget-%ID%-item ul li .sub-container.non-mega .sub {padding: 20px 20px 20px 0;}
#dc_jqmegamenu_widget-%ID%-item ul li .sub-container.non-mega li {padding: 0; width: 190px; margin: 0;}
#dc_jqmegamenu_widget-%ID%-item ul li .sub-container.non-mega li a {padding: 7px 5px 7px 22px; background: url(skins/images/arrow_off.png) no-repeat 7px 10px;}
#dc_jqmegamenu_widget-%ID%-item ul li .sub-container.non-mega li a:hover {color: #a32403; background: #efefef url(skins/images/arrow_on.png) no-repeat 7px 10px;}
As you can see, there's nothing blue in that CSS; I don't know where the blue is coming from. It should be white. Maybe I have to try putting !important after the #fff ... but that didn't seem to work either. You can see the menu in action here.
Any help with this conundrum would be greatly appreciated!
These two classes have the blue color:
.catalyst-widget-area a, .catalyst-widget-area a:visited {
color: #3A639A !important;
text-decoration: none !important;
}
This is why your text is blue. So make a new style sheet or change it.
In Firebug, you can see that this style is being applied in dynamik-min.css on Line 2
.catalyst-widget-area a, .catalyst-widget-area a:visited {
color: #3A639A !important;
text-decoration: none !important;
}
Note the !important flag on the color attribute.
You can simply apply an !important to to #dc_jqmegamenu_widget-2-item ul li a like this:
#dc_jqmegamenu_widget-2-item ul li a {
color: #FFFFFF !important;
}
I see a blue style applied to links:
dynamik-min.css, line 2
.catalyst-widget-area a, .catalyst-widget-area a:visited {
color: #3A639A !important;
text-decoration: none !important;
}
Add this to your css
#dc_jqmegamenu_widget-2-item ul li a{color:#fff !important;}
#dc_jqmegamenu_widget-2-item ul li a:hover{#3A639A !important}
You can't match an ID selector in CSS with a wildcard (at least not the way you are trying)
you can do any of these:
#exactCaseSensitiveMatchOnTheID{...}
div[id*='substringInTheID']{...}
However realistically if you want to match on multiple, similar elements... add a class to them and select by class instead.
div.myClassName{...}

How can I use CSS to align this menu with the rest of the content of my website?

I have a menu that I just can't seem to get in the proper position. It seems to float:left. But I don't see any place in my CSS where I'm floating anything left.
I'm okay with firebug, but not a guru. Does anybody know how I can get this to properly align with the rest of the content of the website?
I don't know if I should be using float:, or text-align, or whatever CSS function. I also don't know if I should be using # or . before the ID or class.
So it looks like this:
If it helps, the site is here. Thanks for any guidance anybody can offer.
EDIT:
The following is the CSS from the menu I'm using, which, again, looks like the picture on the latest version of FF on all of my computers:
#dc_jqmegamenu_widget-%ID%-item {font: normal 13px Arial, sans-serif; line-height: 16px;}
#dc_jqmegamenu_widget-%ID%-item ul, #dc_jqmegamenu_widget-%ID%-item ul, #dc_jqmegamenu_widget-%ID%-item ul li {margin: 0; padding: 0; border: none;}
#dc_jqmegamenu_widget-%ID%-item ul.menu {background: #8998a8 url(skins/images/bg_grey.png) repeat-x 0 -80px; width: 100%; height: 40px; border-right: 1px solid #8B949F; border-left: 1px solid #8B949F; position: relative;}
#dc_jqmegamenu_widget-%ID%-item ul li {float: left; margin: 0; padding: 0; font-size: 13px; font-weight: bold;}
#dc_jqmegamenu_widget-%ID%-item ul li a {float: left; display: block; color: #fff; padding: 12px 38px 12px 25px; background: url(skins/images/bg_grey.png) repeat-x 100% 0; text-shadow: 1px 1px 1px #000; text-decoration: none;}
#dc_jqmegamenu_widget-%ID%-item ul li a.dc-mega {position: relative;}
#dc_jqmegamenu_widget-%ID%-item ul li a .dc-mega-icon {display: block; position: absolute; top: 18px; right: 15px; width: 8px; height: 6px; background: url(skins/images/arrow.png) no-repeat 0 0;}
#dc_jqmegamenu_widget-%ID%-item ul li.mega-hover a, #dc_jqmegamenu_widget-%ID%-item ul li a:hover {background-position: 100% -40px; color: #000; text-shadow: none;}
#dc_jqmegamenu_widget-%ID%-item ul li.mega-hover a .dc-mega-icon {background-position: 0 100%;}
#dc_jqmegamenu_widget-%ID%-item ul li .sub-container {position: absolute; background: url(skins/images/bg_sub_left.png) no-repeat 0 100%; padding-left: 20px; margin-left: -3px;}
#dc_jqmegamenu_widget-%ID%-item ul li .sub {background: url(skins/images/bg_sub.png) no-repeat 100% 100%; padding: 20px 20px 20px 10px;}
#dc_jqmegamenu_widget-%ID%-item ul li .sub-container.mega .sub {padding: 20px 20px 10px 0;}
#dc_jqmegamenu_widget-%ID%-item ul.full-width li .sub-container.mega .sub {margin-right: -2px;}
#dc_jqmegamenu_widget-%ID%-item ul li .sub .row {width: 100%; overflow: hidden; clear: both;}
#dc_jqmegamenu_widget-%ID%-item ul li .sub li {list-style: none; float: none; width: 170px; font-size: 1em; font-weight: normal;}
#dc_jqmegamenu_widget-%ID%-item ul li .sub li.mega-hdr {margin: 0 10px 10px 0; float: left;}
#dc_jqmegamenu_widget-%ID%-item ul li .sub li.mega-hdr.last {margin-right: 0;}
#dc_jqmegamenu_widget-%ID%-item ul li .sub a {background: none; border: none; text-shadow: none; color: #111; padding: 7px 10px; display: block; float: none; text-decoration: none; font-size: 0.9em;}
#dc_jqmegamenu_widget-%ID%-item ul li .sub li.mega-hdr a.mega-hdr-a {padding: 5px 5px 5px 15px; margin-bottom: 5px; background: #8A98A9 url(skins/images/bg_mega_hdr.png) no-repeat 0 0; text-transform: uppercase; font-weight: bold; color: #fff; text-shadow: 1px 1px 1px #333;}
#dc_jqmegamenu_widget-%ID%-item ul li .sub li.mega-hdr a.mega-hdr-a:hover {color: #000; text-shadow: none;}
#dc_jqmegamenu_widget-%ID%-item ul .sub li.mega-hdr li a {padding: 4px 5px 4px 20px; background: url(skins/images/arrow_off.png) no-repeat 5px 8px; font-weight: normal;}
#dc_jqmegamenu_widget-%ID%-item ul .sub li.mega-hdr li a:hover {color: #a32403; background: #efefef url(skins/images/arrow_on.png) no-repeat 5px 8px;}
#dc_jqmegamenu_widget-%ID%-item ul .sub ul li {padding-right: 0;}
#dc_jqmegamenu_widget-%ID%-item ul li .sub-container.non-mega .sub {padding: 20px 20px 20px 0;}
#dc_jqmegamenu_widget-%ID%-item ul li .sub-container.non-mega li {padding: 0; width: 190px; margin: 0;}
#dc_jqmegamenu_widget-%ID%-item ul li .sub-container.non-mega li a {padding: 7px 5px 7px 22px; background: url(skins/images/arrow_off.png) no-repeat 7px 10px;}
#dc_jqmegamenu_widget-%ID%-item ul li .sub-container.non-mega li a:hover {color: #a32403; background: #efefef url(skins/images/arrow_on.png) no-repeat 7px 10px;}
SOLVED:
It was a #wrap function error ... dealing with Catalyst. Thanks for all those who tried to help.
If you want to align centered horizontal you need to set margin: 0px auto;
#edit: With no float btw.
It's hard to tell from your picture so I'll take a stab in the dark.
Give the #navbar-1-wrap (which I presume is your menu bar) the following properties in your CSS file. If any of these already exist for it, delete and use these new ones.
width: 920px;
margin: 0 auto;
Ok. That completes my stab in the dark.

Change the mobile menu on twenty twelve for WordPress?

I am using the theme twenty twelve for wordpress http://wordpress.org/extend/themes/twentytwelve and have changed the menu so that it looks good for the desktop. In the mobile version, the button for the menu shows up but when you click it appears my regular menu. I would like to style down the mobile menu without my normal menu is affected but can not find where to do it. My site is not online, so I can not give a link to my site
twenty twelve demo http://twentytwelvedemo.wordpress.com/
This is my destop menu that looks ok.
This is the mobile menu that I want to style without affect the desktop menu
Have changed the following css to style my desktop menu
.main-navigation ul.nav-menu,
.main-navigation div.nav-menu > ul {
border-bottom: 2px solid #f68a1f;
border-top: none;
margin: 0 0 2px 0;
padding: 0px;
padding-top: 50px;
width: 550px;
}
.main-navigation ul {
float: right;
margin: 0;
padding: 0;
list-style: none;
}
.main-navigation li a,
.main-navigation li {
list-style: none;
float: left;
width: 90px;
margin:0px;
}
.main-navigation li a {
color: #292A2B;
display: block;
padding: 5px 5px;
text-align:center;
text-decoration: none;
font-weight: normal;
font-size: 14px;
line-height: 30px;
border-radius: 10px 10px 0px 0px;
-moz-border-radius: 10px 10px 0px 0px;
-webkit-border-bottom-right-radius: 0px;
-webkit-border-bottom-left-radius: 0px;
}
.main-navigation li a:hover {
color: #ffffff;
background-color: #f68a1f;
border-radius: 10px 10px 0px 0px;
-moz-border-radius: 10px 10px 0px 0px;
-webkit-border-bottom-right-radius: 0px;
-webkit-border-bottom-left-radius: 0px;
}
.main-navigation li {
margin: 0 40px 0 0;
margin: 0 1rem 0 0;
position: relative;
}
.main-navigation li ul {
display: none;
margin: 0;
padding: 0;
position: absolute;
top: 100%;
z-index: 1;
}
.main-navigation li ul ul {
top: 0;
left: 100%;
}
.main-navigation ul li:hover > ul {
color: #ffffff;
background-color: #f68a1f;
border-radius: 10px 10px 0px 0px;
-moz-border-radius: 10px 10px 0px 0px;
-webkit-border-bottom-right-radius: 0px;
-webkit-border-bottom-left-radius: 0px;
}
.main-navigation li ul li a {
color: #292A2B;
display: block;
padding: 5px 5px;
text-align:center;
text-decoration: none;
font-weight: normal;
font-size: 14px;
line-height: 30px;
border-radius: 10px 10px 0px 0px;
-moz-border-radius: 10px 10px 0px 0px;
-webkit-border-bottom-right-radius: 0px;
-webkit-border-bottom-left-radius: 0px;
}
.main-navigation li ul li a:hover {
color: #ffffff;
background-color: #f68a1f;
border-radius: 10px 10px 0px 0px;
-moz-border-radius: 10px 10px 0px 0px;
-webkit-border-bottom-right-radius: 0px;
-webkit-border-bottom-left-radius: 0px;
}
.main-navigation .current-menu-item > a,
.main-navigation .current-menu-ancestor > a,
.main-navigation .current_page_item > a,
.main-navigation .current_page_ancestor > a {
color: #ffffff;
background-color: #f68a1f;
}
The entire css file from theme http://pastebin.com/SFaT4BCn
Do you use media queries? Try to use media queries to set styles for specific device resolutions.
Found /* =Media queries /* Minimum width of 600 pixels. */ in CSS and the theme use mobile first. Just moved my code to that section.

Making a menu button larger when active in Drupal 7

Similar to http://www.austintexas.gov/government I want to make a menu button bigger when it is active.
Here is my css for my main menu
#mobileMenu_mm1 {
margin: 10px 20px;
padding: 3px 0px;}
#navigation {
margin: 0px auto;
float: left;}
#main-menu{
clear: both;
float: left;
color: #fff;
font-size: 18px;
margin: 0px auto;
overflow: hidden;
width: 100%;}
#main-menu ul {
float: left;
margin-top: 10px;
margin-left: 20px;
padding: 0px 15px;}
#main-menu li {
float: left;
list-style-type: none;
font-weight: 400;
color: #333 !important;
background: rgb(0, 25, 60);
background: rgba(0, 25, 60, 0.9);}
#main-menu li a {
color: #777;
display: block;
padding: 7px 7px 7px 7px;
text-decoration: none;
line-height: 12px;}
/*----------------------MENU SPECIFIC COLORS--------------*/
#main-menu li#dhtml_menu-305{
border-radius: 15px 15px 0px 0px;
border-right: 2px solid #e6e7de;
background: #D1B37F;
}
#main-menu li#dhtml_menu-50692{
border-radius: 15px 15px 0px 0px;
border-right: 2px solid #e6e7de;
background: #ffff90;
}
#main-menu li#dhtml_menu-50690{
border-radius: 15px 15px 0px 0px;
border-right: 2px solid #e6e7de;
background: lightblue;
}
#main-menu li#dhtml_menu-50207{
border-radius: 15px 15px 0px 0px;
border-right: 2px solid #e6e7de;
background: #CAC37F;
}
#main-menu li#dhtml_menu-50207 li{
background: #CAC37F;
}
#main-menu li#dhtml_menu-50691{
border-radius: 15px 15px 0px 0px;
background: #E4B04A;
}
#main-menu li a:hover {
border-radius: 15px 15px 0px 0px;
background: rgb(200, 200, 200);
background: rgba(200, 200, 200, 0.7);
height: 35px;}
#main-menu li a .sf-sub-indicator {
display: block;
overflow: hidden;
position: absolute;
z-index: 15;
text-indent: -9999px;}
#main-menu li ul li a,
#main-menu li ul li a:link,
#main-menu li ul li a:visited {
border-top-width: 0;
color: #fff;
font-size: 14px;
padding: 10px 10px;
text-transform: none;
line-height: 13px;
width: 105px;}
#main-menu li ul {
height: auto;
padding: 0px 0px;
left: -9999px;
margin: 0 0 0 -2px;
position: absolute;
z-index: 15;
width: 0px;}
#main-menu li ul a {width: 110px;}
#main-menu li ul ul {margin: -33px 0 0 124px;}
#main-menu li:hover>ul,
#main-menu li.sfHover ul {left: auto;}
#main-menu ul li.leaf, #main-menu ul li.expanded, #main-menu ul li.collapsed {list-style:none;}
#main-menu ul.menu li {margin: 0;}
#main-menu li.expanded, #main-menu li.collapsed, #main-menu li.leaf {margin: 0;padding: 0;}
HTML/PHP
<nav id="navigation" role="navigation">
<div id="main-menu">
<?php
$main_menu_tree = menu_tree(variable_get('menu_main_links_source', 'main-menu'));
print drupal_render($main_menu_tree);
?>
</div>
</nav><!-- end main-menu -->
<?php if ($page['header']): ?>
<div id="header" class="sixteen columns" style="margin: 0; padding: 0;>
<?php print render($page['header']); ?>
</div>
<?php endif; ?>
</div>
</div>
</header>
Here is a screenshot
Things I've Tried
I have already tried using :active and :current. For some reason only the first button on my menu has an active class given to it. Cheers!
Nothing is better than a live example:
http://jsfiddle.net/g105b/76JDZ/
The example uses JavaScript to add the active class to the currently selected li element, but the effect you are looking for is purely CSS.
A feature of Drupal is to automatically add the class name active to the currently selected li, so you can completely ignore the JavaScript in the linked example, and simply take the concept shown in CSS.
Use .active class name. All active menu links in Drupal has a class name active.
#main-menu li.active
If you are willing to select only the menu links that have children, use .expanded class name.
#main-menu li.expanded
Hope this works... Muhammad.

How to properly position 3rd level menu

If you look here under "About ISL" -> "Board of Trustees" you can see I have created a third level dropdown, but how can I properly align that drop down? Below you will see my css.
#menudiv {
width: 999px;
float: left;
clear: left;
height: 250px;
background: url(images/top_bg.png) no-repeat;
margin-top: 10px;
}
#mainmenu {
width: 948px;
height: 63px;
float: left;
margin-left: 16px;
margin-top: 5px;
border: 1px solid #D5D5D5;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
-webkit-box-shadow: 0px 1px 2px rgba(0,0,0,0.1);
-moz-box-shadow: 0px 1px 2px rgba(0,0,0,0.1);
background: url(images/nav_bg.gif) repeat;
}
.mainnav {
margin: 0;
padding: 0;
list-style: none;
}
.mainnav * {
margin: 0;
padding: 0;
list-style: none;
}
.mainnav ul {
position: absolute;
top: -999em;
display: none;
}
.mainnav li {
float: left;
position: relative;
z-index: 999;
height: 63px;
line-height: 55px;
margin-right: 0px;
border-right: 1px solid #D5D5D5;
}
.mainnav li.last {
border-right: none;
}
.mainnav a {
display: block;
font-size: 19px;
margin: 0;
color: #cc9900;
font-family: Copperplate,Arial,Helvetica,Sans serif;
font-weight: 600;
text-decoration: none;
padding: 3px 13px 3px 12px;
color: #555;
text-shadow: 0 1px 1px white;
}
.mainnav li:hover {
text-decoration: none;
border-bottom: solid 0px #ccc;
background: white;
}
.mainnav ul li {
width: 132px;
}
.mainnav li:hover ul,
ul.mainnav li.sfHover ul {
left: 0px;
top: 50px;
padding-top: 0px;
width: 132px;
border-bottom: solid 0px #eaeaea;
background: url(images/nav_dropdown_shadow.gif) repeat-x top;
padding: 6px 0 0px 0px;
margin: 13px 0 0 -1px;
border: 1px solid #D5D5D5;
-moz-border-radius-bottomleft: 3px;
-webkit-border-bottom-left-radius: 3px;
-moz-border-radius-bottomright: 3px;
-webkit-border-bottom-right-radius: 3px;
-webkit-box-shadow: 0px 1px 3px rgba(0,0,0,0.1);
-moz-box-shadow: 0px 1px 3px rgba(0,0,0,0.1);
width: 175px;
border-bottom-left-radius: 3px 3px;
border-bottom-right-radius: 3px 3px;
}
.mainnav li:hover li ul,
.mainnav li.sfHover li ul {
top: -999em;
}
.mainnav li li:hover ul,
ul.mainnav li li.sfHover ul {
left: 132px;
top: -8px;
}
.mainnav li:hover ul,
.mainnav li li:hover ul {
top: -999em;
}
.mainnav li li {
color: #555;
display: block;
padding: 0px;
height: auto !important;
border: none;
width: 175px;
background: url(images/nav_dropdown_bg.gif) repeat;
margin: 0;
}
.mainnav li li a:link,
.mainnav li li a:visited {
display: block;
height: auto !important;
line-height: 30px;
color: #333;
font-weight: normal;
font-family: arial,helvetica,sans-serif;
font-size: 12px;
border: none;
margin: 0;
padding-left: 10px;
overflow: hidden;
border-bottom: 1px solid #E3E3E3;
}
.mainnav li li :hover {
}
.mainnav li li a:hover {
background: none;
color: #555 ;
border-bottom: 1px solid #E3E3E3;
}
The problem is that the ul.sub-menu li ul.sub-menu is too far to the left and is covered by its parent. How can I fix the right alignment of these ul elements?
On line 211 in your mainmenu.css, adjust the left position of your submenu by something like 178px, that should place the submenu somewhere more comfortable.

Resources