我试图用该主题替换汉堡菜单,我通过编辑子主题中的样式成功删除了汉堡菜单。我在自定义程序中添加了这些代码,但导航链接未显示。我想像默认菜单一样将导航链接设置为水平位置。我将不胜感激。谢谢!这是我在自定义程序中添加的代码:
@media screen and ( min-width: 1024px ) and (max-width: 1281px) {
.menu-toggle {
display: none;
}
.site-logo {
max-height: 100px;
}
.has-site-logo .main-navigation {
height: 100px;
}
.has-site-logo .main-navigation > div,
.has-site-logo .main-navigation > ul {
position: relative;
top: 50%;
-moz-transform: translateY(-50%);
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
}
.main-navigation {
font-size: 0.8125em;
line-height: 2.09231em;
clear: none;
float: right;
max-width: 50%;
text-align: right;
}
.main-navigation ul:first-child {
display: block;
}
.main-navigation ul li {
display: inline-block;
}
.main-navigation ul li:hover > ul,
.main-navigation ul li.focus > ul {
display: block;
opacity: 1;
visibility: visible;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
.main-navigation ul a {
border-bottom: 0;
padding: 5px 0 5px 14px;
}
.main-navigation ul ul {
background: white;
border: 1px solid #eeeeee;
display: none;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
float: left;
opacity: 0;
padding: 0 7px;
position: absolute;
top: 27px;
left: 0;
text-align: left;
visibility: hidden;
z-index: 99999;
}
.main-navigation ul ul li {
border-bottom: 1px solid #eeeeee;
padding: 5px 5px 4px;
}
.main-navigation ul ul li:last-of-type {
border-bottom: 0;
}
.main-navigation ul ul li a {
line-height: 1.5;
padding: 5px;
width: 180px;
}
.main-navigation ul ul ul {
left: 100%;
top: 0;
}
.main-navigation ul ul li a,
.main-navigation ul ul ul li a,
.main-navigation ul ul ul ul li a {
padding-left: 5px;
}
}
这是添加代码后的样子。汉堡包消失了,但是我的导航链接不会水平显示。我正在使用默认的Wordpress主题抓取工具进行测试。