问题
I'm using the twentyeleven theme for wordpress 3.4.2. The default theme menu shows a dropdown on hover. What I'd like to do is have the current menu item's submenu displayed. What I've achieved thus far is diplaying the submenu by setting the css property display:visible
.
This link, http://www.gq.com shows an example of what I'm trying to achieve.
The related CSS styles are as follows:
#access {
clear: both;
display: block;
float: left;
margin: 0px auto 15px;
width: 100%;
height: 36px;
}
#access ul {
font-size: 13px;
list-style: none;
margin: 0 0 0 -0.8125em;
padding-left: 0;
}
#access li {
float: left;
position: relative;
}
#access a {
display: block;
line-height: 2.8em;
padding: 0 1.2125em;
}
#access ul ul {
display: none;
float: left;
margin: 0;
position: absolute;
top: 2.9em;
left: 0;
width: 188px;
z-index: 99999;
}
#access ul ul ul {
left: 100%;
top: 0;
}
#access ul ul a {
border-bottom: 1px dotted #ddd;
color: #444;
font-size: 13px;
font-weight: normal;
height: auto;
line-height: 1.4em;
padding: 10px 10px;
width: 168px;
}
#access ul li:hover>ul {
display: block;
}
来源:https://stackoverflow.com/questions/12866254/dispaying-current-menu-items-submenu-twentyeleven-wordpress