I am having trouble with the active link I can’t get the submenu to static display. I need the hover to do what it is doing. But say the active link is home I need the home sub menu to display and if you hover over another menu item
it will display and once removed the statically active link will still be there.
If you put a special class on the body tag of each main page, like <body class=“home”> than place a matching ID on the sub list (e.g. <ul id=“home”>) you can make a rule to display that UL when on the Home pages, something like
.home #home {display…}
EDIT: Hmm, this will cause a bit of a mess when other links are hovered, though, without some more elaborate CSS…
I’m afraid you have not understood the purpose of the :active pseudo class. It only effects the anchor state in that brief moment that it is clicked, it has been confused with current page styling by many people.
Read through this recent thread for more explanations on it. Selected or Active?
Your using a WP theme so it looks like they have already provided you with a class to target your current page styles with. In the html on your home LI you will see this class.
thank you for all your help I have been looking at you web site and have book marked it. I was going to make sure that this menu was done in complete css and with your help it is ta
It could still use some improvement. Using display:none; to hide sub menus is not good practice from an accessibility standpoint. It is much better to hide the sublist off-screen with a large negative margin.
This Menu is similar to what you are doing, if you view the page source you will find these rules that hide and show the sublist.
#nav li ul {
position:absolute;
height:26px;
left:0;
top:30px;
[COLOR=Blue]margin-left:-999em;[/COLOR]
background:#EEF;
}
#nav li:hover ul,
#nav li.sfhover ul {
[COLOR=Blue]margin-left:0;[/COLOR][COLOR=DarkGreen]/*show the sub ul on hover*/[/COLOR]
}
That way your menu can still be tabbed through by keyboard users.