Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Sub navigation colors

Posted on 2013-11-08
3
Medium Priority
?
153 Views
Last Modified: 2013-11-11
Hello, I'm modifying a .css and I want to be able to have the .current state for a sub nav to be a different color than the .current state for a parent nav. Below is the hover color for a sub and the .current color.

#leftcol ul.menu ul li a:hover{
      color: #872835;
}

.menu .current a span {
  color: #EEC015;
}

What is the code for making the .current a span for a sub nav?
0
Comment
Question by:DancingFighterG
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 54

Accepted Solution

by:
Scott Fell,  EE MVE earned 1500 total points
ID: 39635594
You don't have enough info to really help so I am going to improvise.  I am not using span's in this example http://jsbin.com/ukUrIxa/1/edit?html,css,output

Leave the #leftcol out of your css for the menu unless you have a class menu someplace else that requires different styles.  

.menu a{color:black;}
.menu .current a{color:red;}
.menu .current ul a{color:green;}

Open in new window

  <div id="leftcol">
     <ul class="menu">
          <li><a href="#">Item 1</a></li>
          <li class="current"><a href="#">Item 2</a>
               <ul>
                     <li><a href="#">Item 2.1</a></li>
                    <li><a href="#">Item 2.2</a></li>
               </ul>
          </li>
       <li><a href="#">Item 3</a>
               <ul>
                     <li><a href="#">Item 3.1</a></li>
                    <li><a href="#">Item 3.2</a></li>
               </ul>
          </li>
    </ul>
</div>

Open in new window

0
 

Author Comment

by:DancingFighterG
ID: 39639141
Here is all the section related to the menu look:

#leftcol ul{
      list-style:none;
}

#leftcol ul.menu li{
      line-height:20px;
}

#leftcol ul.menu ul li a span{
      padding-left: 20px;
}

.menu li a, .menu li a:link {
    background: url("../images/menu_arrow.gif") no-repeat scroll left top transparent;
    color: #fff;
    display: block;        
    font: bold 13px/33px verdana;
    height: 33px;
    padding-left: 20px;
    position: relative;
    text-align: left;
    text-decoration: none;
}

.menu li a:hover{
      color: #EEC015;
}

#leftcol ul.menu ul li a:hover{
      color: #872835;
}

.menu .parent ul li a {
      font: 12px/33px Verdana;
      background: url("../images/submenu.gif") no-repeat scroll left top transparent;
}

.menu .current a span {
  color: #EEC015;
}

________________________________________________________________________________

Overall the following code puts the correct color for the submenu items as a hover:

#leftcol ul.menu ul li a:hover{
      color: #872835;
}

With that being said when someone clicks on the submenu I need the submenu on click to stay the same color as the hover color. The following code is handling the coloring for all menus that are clicked

.menu .current a span {
  color: #EEC015;
}
0
 

Author Comment

by:DancingFighterG
ID: 39639296
Ok I figured it out
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question