简体   繁体   English

如何制作一个也适用于移动设备的水平滚动导航栏

[英]How can I make a Horizontal scrolling nav bar that also works with mobile

So I have a website about the NBA and the problem is there is 30 teams in the NBA.所以我有一个关于 NBA 的网站,但问题是 NBA 有 30 支球队。 When I make a nav bar it takes up half the page because there is 30 teams lol.当我制作导航栏时,它占据了一半的页面,因为有 30 个团队哈哈。 How can I make a nav bar that scrolls horizontally to the right so just more teams keep popping up as your scroll.如何制作一个向右水平滚动的导航栏,以便在滚动时不断弹出更多团队。 I also need it to work for mobile version so I need this nav bar to be responsive.我还需要它适用于移动版本,所以我需要这个导航栏来响应。 Thank you very much.非常感谢。

To enable horizontal scrolling, you should add something like this in CSS:要启用水平滚动,您应该在 CSS 中添加如下内容:

.enableHorizScrolling {
  max-width : 10000px;
  overflow-x : auto;
}

max-width will instruct your element to keep adding team icons to the right, and overflow-x is for deciding if/when to show a scrollbar max-width 将指示您的元素继续在右侧添加团队图标,并且 overflow-x 用于决定是否/何时显示滚动条

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

相关问题 无法为手机制作水平导航栏? - Unable to make horizontal nav bar for mobile? 如何使页脚停止与移动导航栏重叠? 在移动视图中,导航栏位于页脚下方。 任何解决方案? - How can I make the footer stop overlapping with the mobile NAV bar? On the mobile view, the NAV bar goes under the footer. Any solutions? 对于移动Webkit,如何在触摸/拖动时使水平菜单栏滚动? - For mobile webkit, how can I make the horizontal menu bar scrollable when you touch/drag it? (移动)如何在滚动过程中隐藏导航栏 - (mobile) How to keep the nav bar hidden during scrolling 在移动设备中滚动时如何隐藏水平滚动条 - How to hide the horizontal scroll bar while scrolling in mobile 如何制作一个居中但响应迅速的 html 导航栏 - How to make an html nav bar that is centered but also responsive 如何删除水平固定导航栏中列表项之间的“间隙” - How can I remove the “gaps” between my list items in a horizontal fixed nav bar 如何在水平网页的导航栏中突出显示? - How can I make a highlight in the navigation bar of a horizontal webpage? 如何使用html工作的javascript也可以在cshtml中工作? - How can I make a javascript that works in html also work in cshtml? 最小化后,如何使网站显示水平滚动条? - How do I make my website display a horizontal scrolling bar when it is minimized?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM