December 17, 200718 yr My Site: here My CSS: here As you can see, I've got my css menu working in all browsers from IE6 to FF & Opera, however I have been unable to implement one crucial feature... If a user clicks on the 'COMMUNITY' link, or either of the three links in the 'COMMUNITY' pop-up menu, I would like the 'COMMUNITY' box to remain white (the same as when you hover over it) as opposed to going back to its default grey background... How do I do this in my current css menu and thus let the user know exactly where on the site they are?
December 17, 200718 yr Well I'm still racking my brain over this, anyone care to please shed some light?
December 18, 200718 yr If I think what your asking is "How do I keep the menu item white when the user visits that page?" then I think you need to give the chosen menu item a unique class or id in the HTML and then style it in the CSS, for example "active". You can then give that active class it's own style, in this case a white background. Something like this: HTML:<li [i]class="active"[/i]><a href="/community.php" title="Community">COMMUNITY</a> CSS: #menu .active a { background: #fff; } There's a more detailed tutorial here. Might need to play around with the css until it works, but I managed to do it my site. See nav on right hand side. Portfolio is darker blue and text is left-aligned.
December 18, 200718 yr Brilliant, was exactly what I needed . You just forgot to add an 'a' after #menu .active, but I figured that out in no time .
Create an account or sign in to comment