[solved] Reverse text color horizontal CSS menu problem

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
giggler
Forum Members
Forum Members
Posts: 197
Joined: Tue Oct 09, 2007 7:08 am

[solved] Reverse text color horizontal CSS menu problem

Post by giggler »

I was trying to create the horizontal menu with the text color reverse to white on hover and background blue. The problem is when I have a main item with submenu that are both menuparent, any text color changed to menuparent effects the menparent of the submenu. (see 1st attached image) If I use white for menuparent, then the submenu item which are also menuparent become white as well and doesn't work since the submenu drop down has white background. I want the text to be black.

Code: Select all

<li class="menuparent"><a class="menuparent" 
href="http://www.url.com/services.html" ><dfn>3: </dfn>Services</a>

<ul>
	<li class="menuparent"><a class="menuparent" 
href="http://www.url.com/services/medicare-services.html" ><dfn>3.1: </dfn>Medicare Services</a>

</li>
this is the css that makes menuparent white:

Code: Select all

#primary-nav li.menuparent:hover .menuparent{ 
color: #fff;
}
If I don't use this css to set it to white, then it hovers white, but once you are on the submenu dropdown, it goes back to black and is inconsistent (see 2nd attachment)...

Thanks!
Attachments
Picture 41.png
Last edited by giggler on Mon Dec 31, 2007 8:44 am, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Reverse text color horizontal CSS menu problem

Post by Dr.CSS »

To color/change the top level use your existing calls to change second level add another li to your calls...

#primary-nav li.menuparent:hover{
color: #fff;
}

#primary-nav li li.menuparent:hover{
color: #fff;
}

For IE6 you will need the add an h to menuparent  menuparenth

If you look at default install drop down CSS menu you will see some calls duplicated with an h on the end and the template will have a call for an IE6 JS...
giggler
Forum Members
Forum Members
Posts: 197
Joined: Tue Oct 09, 2007 7:08 am

Re: Reverse text color horizontal CSS menu problem

Post by giggler »

Thanks Mark,

I got it to work - thanks for mentioning the "h" for IE6. I kept thinking the extra h was some type of typo.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Reverse text color horizontal CSS menu problem

Post by Dr.CSS »

[solved]  ?...
Post Reply

Return to “Layout and Design (CSS & HTML)”