[英]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.