简体   繁体   English

如何在调整大小时从 Wordpress 中删除移动菜单但保留桌面菜单?

[英]How to remove mobile menu from Wordpress on resize but keep the desktop one?

I'm wondering if there's any way to remove a mobile menu from Wordpress, which automatically is activated at 48em or 767px .我想知道是否有任何方法可以从 Wordpress 中删除移动菜单,它会在48em767px自动激活。

There is no code in the CSS of my site which enables that hamburger menu and I tried one solution such as adding to styles.css the following code:我网站的 CSS 中没有启用汉堡菜单的代码,我尝试了一种解决方案,例如将以下代码添加到 styles.css:

 button.menu-toggle {
    display: none !important;
 }

and

 #top-menu {
      display: block !important;
 }

(the site is http://areolamodels.com/ ) (该网站是http://areolamodels.com/

But it still won't work – the hamburger button is gone, but the top-menu displays in the design, which is different from the desktop version and I want to have to desktop version... Is there any js function that does it instead of CSS?但是还是不行——汉堡按钮不见了,但是设计中显示的是top-menu,和桌面版不一样,我想要桌面版... 有没有什么js函数可以做到而不是 CSS?

Thanks!谢谢!

you may add this code :您可以添加此代码:

 @media all and (max-width:767px) { #top-menu { display: block!important; margin: 0; text-align: center; background: none; } .main-navigation li { display: inline-block; margin: 0 10px; } button.menu-toggle { display: none!important; } }

it will adjust the style so the menu remain like desktop它将调整样式,使菜单保持像桌面一样

Remove @media screen and (min-width: 48em) from删除@media screen and (min-width: 48em)

@media screen and (min-width: 48em)
.main-navigation {
    width: auto;
}

Check out this selector:看看这个选择器:

.js .main-navigation.toggled-on > div > ul

This is the one toggling display这是一个切换显示

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM