Archived

This topic is now archived and is closed to further replies.

  • 0

Resolved Can't Get The Nav Bar Css To Work! Please Help


Question

Posted · Report post

Hi folks, I've tried everything... I've searched through the forums, docs, etc, tried all the CSS I could find in here and nothing... I can't find the way to customize the colors of my nav bars properly.

The URL: http://designsbyfelicia.com

There's 2 nav bars I'm customizing: the brandnav (purple header section with logo and nav), and the classic nav (black nav bar)

Here are the problems:

1. on the Brandnav, I've managed to code everything I wanted properly except the "li" active state when the user is on a child page. For example, the "services" page has a couple of child pages. When a user is in one of those, there's a white background in the "services" link that I can't find a way to remove (should be transparent, or the same purple color as background). Go to this child page so you can see: http://designsbyfelicia.com/services/custom-furniture-cabinetry/

2. On the Black Nav bar, I'm trying to simply do this:

- no background color on hover

- text color gray

- text color hover: light purple

- text color active: dark purple

That's all!!! And yet nothing I code seems to have an effect...

Here's my CSS code for these two sections at the moment:


#brandnav {

  background-color: #7e60c4;

  border-top: 1px solid #9c85d2 !important;

  border-bottom: 1px solid #000000 !important;

}

#brandnav .content-pad {

  padding: 0em 0 1em 0;

}

#brandnav .brandnav-nav {

  position: relative;

  top: 20px;

}

#brandnav .brandnav-nav ul#menu-brandnav {

  font-family: "Century Gothic", "Helvetica Neue", Helvetica, Arial, sans-serif !important;

  font-size: 13px !important;

  font-weight: 600 !important;

  line-height: 20px !important;

  color: #333333;

  text-shadow: 1px 1px 0 #9c85d2 !important;

}

#brandnav .brandnav-nav ul#menu-brandnav li a {

  color: #333333;

  padding: 10px;

  -webkit-transition: all 0.2s ease-out;

  -moz-transition: all 0.2s ease-out;

  transition: all 0.2s ease-out;

}

#brandnav .brandnav-nav ul#menu-brandnav li a:hover {

  color: #eeeeee !important;

  text-shadow: -1px -1px 0 #222222 !important;

  background-color: transparent !important;

}

#brandnav .brandnav-nav ul#menu-brandnav li:hover {

  background-color: transparent !important;

}

#brandnav .main-nav li:hover,

#brandnav .main-nav .current-menu-ancestor a,

#brandnav .main-nav li.current-menu-ancestor ul a,

#brandnav .main-nav li.current_page_item a,

#brandnav .main-nav li.current-menu-item a,

#brandnav .main-nav li.current_page_parent a,

#brandnav .sf-menu li li,

#brandnav .sf-menu li li li {

  background-color: transparent !important;

  color: #eeeeee !important;

  text-shadow: -1px -1px 0 #222222 !important;

}



#nav.container div.texture {

  background-color: #333333;

  border-top: 1px solid #9c85d2 !important;

  border-bottom: 1px solid #555555 !important;

  box-shadow: 0 0 6px #222222;

  -moz-box-shadow: 0 0 6px #222222;

  -webkit-box-shadow: 0 0 6px #222222;

}

#nav.container div.navigation_wrap.fix {

  border: none !important;

}

#nav.container .main-nav ul#menu-main-navigation li {

  font-family: "Century Gothic", "Helvetica Neue", Helvetica, Arial, sans-serif !important;

  font-size: 13px !important;

  font-weight: 400 !important;

  line-height: 20px !important;

  color: #eeeeee !important;

  text-shadow: -1px -1px 0 #000000 !important;

}

#nav.container .main-nav ul#menu-main-navigation li li a {

  color: #eeeeee !important;

  border-right: 1px solid #222222 !important;

  border-left: 1px solid #999999 !important;

  background-color: #333333 !important;

  -webkit-transition: all 0.2s ease-out;

  -moz-transition: all 0.2s ease-out;

  transition: all 0.2s ease-out;

}

#nav.container .main-nav ul#menu-main-navigation li li a:hover {

  color: #baaae0 !important;

  background-color: #333333 !important;

}

#nav.container .main-nav ul#menu-main-navigation li li:hover {

  background-color: #333333 !important;

}

#nav.container li#menu-item-685 a {

  border-left: none !important;

}

#nav.container li#menu-item-688 a {

  border-right: none !important;

}

#nav.container .main-nav .current-menu-ancestor a,

#nav.container .main-nav li.current-menu-ancestor ul a,

#nav.container .main-nav li.current_page_item a,

#nav.container .main-nav li.current-menu-item a,

#nav.container .main-nav li.current_page_parent a,

#nav.container .sf-menu li li,

#nav.container .sf-menu li li li {

  background-color: #333333 !important;

  color: #baaae0 !important;

}

#navbar.container.no_clone.section-navbar.fix {

  background-color: #333333;

  background-repeat: repeat-x;

  background-image: -khtml-gradient(linear, left top, left bottom, from(#555555), to(#333333));

  /* Konqueror */

  background-image: -moz-linear-gradient(#555555, #333333);

  /* FF 3.6+ */

  background-image: -ms-linear-gradient(#555555, #333333);

  /* IE10 */

  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #555555), color-stop(100%, #333333));

  /* Safari 4+, Chrome 2+ */

  background-image: -webkit-linear-gradient(#555555, #333333);

  /* Safari 5.1+, Chrome 10+ */

  background-image: -o-linear-gradient(#555555, #333333);

  /* Opera 11.10 */

  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#555555', endColorstr='#333333', GradientType=0);

  /* IE6 & IE7 */

  -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#555555', endColorstr='#333333', GradientType=0)";

  /* IE8+ */

  background-image: linear-gradient(#555555, #333333);

  /* the standard */

  box-shadow: 0 0 6px #333333;

  -moz-box-shadow: 0 0 6px #333333;

  -webkit-box-shadow: 0 0 6px #333333;

  border-top: 1px solid #9c85d2;

  border-bottom: 1px solid #555555;

}

#navbar.container.no_clone.section-navbar.fix div.content {

  width: 99% !important;

}

#navbar.container.no_clone.section-navbar.fix div.content div.content-pad {

  padding: 0 !important;

}

#navbar.container.no_clone.section-navbar.fix div.content div.content-pad div.navbar.fix.navbar-content-width.pl-color-black-trans {

  border-radius: 0 !important;

  -moz-border-radius: 0 !important;

  -webkit-border-radius: 0 !important;

  -moz-background-clip: padding !important;

  -webkit-background-clip: padding-box !important;

  background-clip: padding-box !important;

  background-image: none !important;

  box-shadow: 0 0 0 transparent !important;

  -moz-box-shadow: 0 0 0 transparent !important;

  -webkit-box-shadow: 0 0 0 transparent !important;

}

#navbar.container.no_clone.section-navbar.fix div.content div.content-pad div.navbar.fix.navbar-content-width.pl-color-black-trans div.navbar-content-pad.fix {

  padding: 0 5px !important;

}

#navbar.container.no_clone.section-navbar.fix div.content div.content-pad div.navbar.fix.navbar-content-width.pl-color-black-trans div.navbar-content-pad.fix #menu-mobile-device-menu li a {

  text-shadow: -1px -1px 0 #000000;

  padding: 10px 10px !important;

}

I appreciate your help with this! We're going live on Friday with the site so I need to resolve this ASAP.

I would also like this opportunity to suggest something to you for a future update: Your framework is so advanced, it great! Customizing Nav colors should not be this hard! I've spent hours and hours on this... Why isn't there a color picker in the admin setting for each nav bar section??? Just include color pickers for text color, background, border, and for normal, hover and active states and you should be able to shake this issue off for good! (I've noticed it's a recurrent issue people have)

Thanks again!

Beny Schonfeld

Share this post


Link to post
Share on other sites

5 answers to this question

Posted · Report post

1. The selector for your active link needs to be adjusted. When I inspect the active menu item using Firebug, I see this class:

menu-item menu-item-type-post_type menu-item-object-page current-page-ancestor menu-item-680
You need to use the current-page-ancestor selector to adjust the active item. 2. In this code, the extra li tags are unnecessary (i.e. li li a can just be li a):
#nav.container .main-nav ul#menu-main-navigation li li a {

  color: #eeeeee !important;

  border-right: 1px solid #222222 !important;

  border-left: 1px solid #999999 !important;

  background-color: #333333 !important;

  -webkit-transition: all 0.2s ease-out;

  -moz-transition: all 0.2s ease-out;

  transition: all 0.2s ease-out;

}

#nav.container .main-nav ul#menu-main-navigation li li a:hover {

  color: #baaae0 !important;

  background-color: #333333 !important;

}

#nav.container .main-nav ul#menu-main-navigation li li:hover {

  background-color: #333333 !important;

}

#nav.container li#menu-item-685 a {

  border-left: none !important;

}

[/code]

Share this post


Link to post
Share on other sites

Posted · Report post

OK, making progress...

On Brandnav, by targeting the following selector I was able to finally remove that white background,...


li#menu-item-680.menu-item.menu-item-type-post_type.menu-item-object-page.current-page-ancestor.menu-item-680 a

As for the other navigation bar, the black one, I tried what you suggested above and nothing. Same result... I don't understand it!

Any other suggestions?

Share this post


Link to post
Share on other sites

Posted · Report post

OK, I went back and deleted all the CSS I had done for the second nav bar (the black one). I simplified a couple of things and now it seems to be working perfectly... I have no idea why I couldn't get this to work before... Maybe I just needed to let it sit for a couple of days :)

Here's the CSS I'm using now:


#nav.container div.texture {

  background-color: #333333;

  border-top: 1px solid #9c85d2 !important;

  border-bottom: 1px solid #555555 !important;

  box-shadow: 0 0 6px #222222;

  -moz-box-shadow: 0 0 6px #222222;

  -webkit-box-shadow: 0 0 6px #222222;

}

#nav.container div.navigation_wrap.fix {

  border: none !important;

}

#nav.container ul li {

  border-right: 1px solid #222222 !important;

  border-left: 1px solid #555555 !important;

}

#nav.container ul li a {

  font-family: "Century Gothic", "Helvetica Neue", Helvetica, Arial, sans-serif !important;

  font-size: 13px !important;

  font-weight: 400 !important;

  line-height: 20px !important;

  color: #eeeeee !important;

  text-shadow: -1px -1px 0 #000000 !important;

  background: transparent !important;

  padding: 5px 14px;

  -webkit-transition: all 0.2s ease-out;

  -moz-transition: all 0.2s ease-out;

  transition: all 0.2s ease-out;

}

#nav.container ul li a:hover {

  color: #baaae0 !important;

}

#nav.container .main-nav .current-menu-ancestor a,

#nav.container .main-nav li.current-menu-ancestor ul a,

#nav.container .main-nav li.current_page_item a,

#nav.container .main-nav li.current-menu-item a,

#nav.container .main-nav li.current_page_parent a,

#nav.container .sf-menu li li,

#nav.container .sf-menu li li li {

  color: #baaae0 !important;

}

#nav.container li#menu-item-685 {

  border-left: none !important;

}

#nav.container li#menu-item-688 {

  border-right: none !important;

}

Share this post


Link to post
Share on other sites

Posted · Report post

Excellent, I'm glad you got it sorted. Thank you for sharing the solution with us.

Share this post


Link to post
Share on other sites

Posted · Report post

The topic was marked as resolved.

Share this post


Link to post
Share on other sites