用滚动条添加div以在同一行上划分
注意:我知道这个问题可能没有意义,但我真的不能说对不起(让我知道一个更合适的问题)
详细信息:基本上我是用水平滚动栏覆盖的一部分的纳维尔,这就是我的方式到目前为止,完成了滚动条,但是如果我添加其他任何内容,那就打破了有关如何制作此工作或替代方案的任何提示?还将Bulma用于容器以及将来的更多内容。
html:
<div class="container is-max-widescreen">
<div class="outer">
<div style="padding-left: 10px; padding-right: 10px;">
<a href="#" class="scrollitem">ITEM</a>
<a href="#" class="scrollitem">ITEM</a>
<a href="#" class="scrollitem">ITEM</a>
<a href="#" class="scrollitem">ITEM</a>
<a href="#" class="scrollitem">ITEM</a>
<a href="#" class="scrollitem">ITEM</a>
<a href="#" class="scrollitem">ITEM</a>
<a href="#" class="scrollitem">ITEM</a>
<a href="#" class="scrollitem">ITEM</a>
<a href="#" class="scrollitem">ITEM</a>
<a href="#" class="scrollitem">ITEM</a>
<a href="#" class="scrollitem">ITEM</a>
<a href="#" class="scrollitem">ITEM</a>
<a href="#" class="scrollitem">ITEM</a>
<a href="#" class="scrollitem">ITEM</a>
<a href="#" class="scrollitem">ITEM</a>
<a href="#" class="scrollitem">ITEM</a>
<a href="#" class="scrollitem">ITEM</a>
<a href="#" class="scrollitem">ITEM</a>
</div>
</div>
</div>
CSS
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@600&display=swap');
/* Menu Scroll Bar */
.outer::-webkit-scrollbar {
height: 8px;
padding-left: 20px;
padding-right: 20px;
}
.outer::-webkit-scrollbar-track {
border-radius: 10px;
}
.outer::-webkit-scrollbar-thumb {
background: rgb(99, 99, 99);
border-radius: 10px;
}
.outer::-webkit-scrollbar-thumb:hover {
background: rgb(120, 120, 120);
}
.scrollitem {
background-color: #222831;
border-radius: 16px;
text-align: center;
display: inline-block;
padding: 1px 13px 1px 13px;
color: #848484;
font-family: 'Poppins', sans-serif;
}
.scrollitem:hover {
background-color: #393e46;
color: #eeeeee;
}
.outer {
background-color: #333;
overflow-y: hidden;
white-space: nowrap;
padding-top: 10px;
padding-bottom: 10px;
}
这是我想要的外观的一个示例:
- 红色是示例中可滚动的文本
NOTE: I'm aware the question may not make sense but i cant really word it right sorry (let me know a more suitable question)
Details: Basically im making a navbar with a horizontal scrollbar covering only part of it, this is how i've done the scrollbar so far but it breaks if i add anything else, any tips on how i could make this work or alternatives? Also Using Bulma for the container and some more stuff in the future.
HTML:
<div class="container is-max-widescreen">
<div class="outer">
<div style="padding-left: 10px; padding-right: 10px;">
<a href="#" class="scrollitem">ITEM</a>
<a href="#" class="scrollitem">ITEM</a>
<a href="#" class="scrollitem">ITEM</a>
<a href="#" class="scrollitem">ITEM</a>
<a href="#" class="scrollitem">ITEM</a>
<a href="#" class="scrollitem">ITEM</a>
<a href="#" class="scrollitem">ITEM</a>
<a href="#" class="scrollitem">ITEM</a>
<a href="#" class="scrollitem">ITEM</a>
<a href="#" class="scrollitem">ITEM</a>
<a href="#" class="scrollitem">ITEM</a>
<a href="#" class="scrollitem">ITEM</a>
<a href="#" class="scrollitem">ITEM</a>
<a href="#" class="scrollitem">ITEM</a>
<a href="#" class="scrollitem">ITEM</a>
<a href="#" class="scrollitem">ITEM</a>
<a href="#" class="scrollitem">ITEM</a>
<a href="#" class="scrollitem">ITEM</a>
<a href="#" class="scrollitem">ITEM</a>
</div>
</div>
</div>
CSS
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@600&display=swap');
/* Menu Scroll Bar */
.outer::-webkit-scrollbar {
height: 8px;
padding-left: 20px;
padding-right: 20px;
}
.outer::-webkit-scrollbar-track {
border-radius: 10px;
}
.outer::-webkit-scrollbar-thumb {
background: rgb(99, 99, 99);
border-radius: 10px;
}
.outer::-webkit-scrollbar-thumb:hover {
background: rgb(120, 120, 120);
}
.scrollitem {
background-color: #222831;
border-radius: 16px;
text-align: center;
display: inline-block;
padding: 1px 13px 1px 13px;
color: #848484;
font-family: 'Poppins', sans-serif;
}
.scrollitem:hover {
background-color: #393e46;
color: #eeeeee;
}
.outer {
background-color: #333;
overflow-y: hidden;
white-space: nowrap;
padding-top: 10px;
padding-bottom: 10px;
}
Here's an example of what i want it to look like:
- Red is the scrollable text seen in example
Current Example: https://codepen.io/shiiiina/pen/YzYQMXy
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论