vet911 Posted April 20, 2012 Share Posted April 20, 2012 I have this horizontal menu with drop downs, I want to show the selected menu item as selected(different color) until I change pages. Here is my css code. I dont' know whic to change, any help would be appreciated. Thanks in advance. #navWrapper { background-color: #cc0000; color: inherit; border-bottom: 8px solid #cc0000; /* height*/ } #nav, #nav ul { padding: 0; margin: 0; list-style: none; font-family: verdana, arial, helvetica, sans-serif; z-index: 100; } #nav a { display: block; text-decoration: none; padding: 0.2em 0.61em 0.3em; border-right: 1px solid #ccc; font-size: 0.9em; color: #eee; background-color: inherit; } #nav li { float: left; width: 10.5em; line-height: 1.2em; margin: 0; } #nav li ul, #nav ul li { width: 14.0em; } #nav ul li a { color: #111; background-color: #ddd; border-right: 0; padding: .2em 1.5em 0.2em; } #nav li ul { position: absolute; display: none; background-color: #ddd; color: inherit; border: 1px solid #555; } #nav li:hover a, #nav a:focus, #nav a:active { color: #fff; background-color: #000; } #nav li:hover ul { display: block; } #nav li:hover ul a { color: #000000; background-color: transparent; } #nav ul a:hover { background-color: #555!important; color: #fff!important; } #nav li.navsection a { font-weight: bold; } /* \ hide from IE5 Mac */ #nav li {width: auto;} Quote Link to comment Share on other sites More sharing options...
BuildMyWeb Posted May 6, 2012 Share Posted May 6, 2012 you could assign an id to the body of each page and do something like this: #page_id .link_id, #page_id2 .link_id2, #page_id3 .link_id3 { background:white; } Quote Link to comment Share on other sites More sharing options...
salem80 Posted May 8, 2012 Share Posted May 8, 2012 If yo use Dynamic or static site you should specified class to the selected menu (In HTML) in HTML <ul class="selected "> the rest of code... </ul> In CSS .selected {background:white; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.