本文代码以博主泪雪的TearSnow主题为示例,介绍主要的实现方式,其他的主题适当修改即可。
.menu-nav-container ul {
margin: 0;
text-indent: 0;
}
.menu-nav-container li a,
.menu-nav-container li {
display: inline-block;
text-decoration: none;
}
.menu-nav-container li {
margin: 0 0;
position: relative;
}
.menu-nav-container li ul {
display: none;
margin: 0;
padding: 0;
position: absolute;
top: 100%;
z-index: 1;
}
.menu-nav-container li ul ul {
top: 0;
left: 100%;
}
.menu-nav-container ul li:hover > ul {
border-left: 0;
display: block;
}
.menu-nav-container li li a, .menu-nav-container li li a:link, .menu-nav-container li li a:visited {
background: #dcdcdc;
width: 100px;
color: #fff;
font-size: 14px;
font-weight: normal;
display: block;
text-transform: uppercase;
float: none;
margin: 0px;
padding: 8px 10px 7px 10px;
-moz-border-radius:300px; border-radius:300px;
}
.menu-nav-container li a, .menu-nav-container li a:link, .menu-nav-container li a:visited
{
display:block;
color: #fff;
font-size:14px;
text-transform: uppercase;
margin: 0 3px;
padding: 9px 10px 6px;
text-decoration: none;
}
.menu-nav-container li ul li a {
background: #efefef;
border-bottom: 1px solid #ededed;
display: block;
font-size: 11px;
font-size: 0.785714286rem;
line-height: 2.181818182;
padding: 8px 10px;
padding: 0.571428571rem 0.714285714rem;
width: 180px;
width: 12.85714286rem;
white-space: normal;
}
.menu-nav-container li ul li a:hover ,.menu-nav-container li ul li a:active{
background: #111;
color: #eee;
padding: 8px 10px 7px 10px;
}
此为主要基本代码,其他的可适当修改。