【问题标题】:Horizontal scroll navigation like facebook or instagram - css水平滚动导航,如 facebook 或 instagram - css
【发布时间】:2021-11-18 18:13:39
【问题描述】:

我的滚动导航有问题。或者实际上我正在寻找一种解决方案,以在移动屏幕上制作水平滚动导航,就像这些天的大多数应用程序一样。 我的菜单是一个超级菜单是一个超级菜单,它在桌面和移动设备上都可以正常工作。 当我使用此代码使其水平滚动时,它不会打开 mega menu

    ul{ /* set's the horizontal layout for the menu */
       white-space: nowrap;
       overflow-x: auto; 
       overflow-y: hidden;
       flex-wrap: inherit !important;
       scrollbar-width: none; /* this will remove scroll-bar for mozilla based browser */
}
    selector ul::-webkit-scrollbar { 
        /* now, let's remove the scroll-bar from the menu */
          display: none; 
        }

Scrollable menu working but not mega menu

如果我删除 overflow-x 或 y 属性,然后大型菜单会显示其内容,但布局是这样的。 after removing overflow proprtie

My Mega Menu

【问题讨论】:

    标签: javascript html css wordpress megamenu


    【解决方案1】:

    如果您使用的是小型设备,则必须指定媒体查询,例如:

    @media screen and (max-width: 600px) {  
      .column {    
        width: 100%;
        height: auto;  
      }
    }
    

    你试过设置max-widthmax-height吗?

    您应该在 Google 上搜索下拉菜单。这个w3schools 页面解释了如何通过它。

    【讨论】:

    • 正如目前所写,您的答案尚不清楚。请edit 添加其他详细信息,以帮助其他人了解这如何解决所提出的问题。你可以找到更多关于如何写好答案的信息in the help center
    • 请注意 w3schools 是大多数社区强烈反对的资源:@​​987654324@
    猜你喜欢
    • 2014-03-01
    • 2011-08-09
    • 1970-01-01
    • 2016-02-08
    • 2011-06-25
    • 2012-04-13
    • 1970-01-01
    • 2018-09-07
    • 2018-11-09
    相关资源
    最近更新 更多