我需要从以下 css 更改什么代码以使菜单彼此靠近而不是彼此下方:
/* =Menu
----------------------------------------------- */
.main-navigation {
clear: both;
display: block;
font-weight: bolder;
}
.main-navigation:after {
clear: both;
content: "";
display: block;
}
.main-navigation ul {
list-style: none;
margin: 0;
padding-left: 0;
}
.main-navigation li {
margin: 0.5em 0;
position: relative;
}
.main-navigation a {
display: block;
font-size: 1.4rem;
font-weight: bold;
margin-right: 2em;
text-decoration: none;
}
.main-navigation ul ul {
background: #e9e0d1;
border: 1px solid rgba( 0, 0, 0, 0.1 );
display: none;
position: absolute;
top: 1.2em;
left: 0;
z-index: 99999;
}
.main-navigation ul ul ul {
left: 100%;
top: 0;
}
.main-navigation ul ul a {
padding: 0 1.5em;
width: 200px;
}
.main-navigation ul ul li {
}
.main-navigation li:hover > a,
.main-navigation li.current_page_item a,
.main-navigation li.current-menu-item a,
.main-navigation ul ul a:hover {
color: #33605a;
}
.main-navigation ul ul :hover > a {
}
.main-navigation ul li:hover > ul {
display: block;
}
/* Small menu */
.menu-toggle {
color: #7c948a;
cursor: pointer;
font-size: 20px;
font-weight: bold;
text-align: center;
}
.main-small-navigation .menu {
display: none;
}
已经尝试从显示块更改为内联,但这只是减少了菜单项之间的填充
这只是取自themeshaper的一个主题。JSFiddle 示例包含所有代码。