如何仅定位第一个跨度?
我遇到 select2 问题,其中原始选择范围文本仍然出现在页面上 (<在下面的示例中,span>Large
)。为了实现这一目标,我尝试过:
.select-option-ui span:first-of-type {
display: none;
}
奇怪的是,这隐藏了 Large
和进一步向下的跨度(在下图中突出显示),这是需要保留的跨度。我需要一种方法来解决这个问题并仅删除第一个跨度,CSS 或 jS/jQuery 选项都可以。
对解决方案以及这是否是 select2 的已知错误感兴趣?
I'm having an issue with select2 where the original select span text still appears on the page (<span>Large</span>
in the below example). To target this I have tried:
.select-option-ui span:first-of-type {
display: none;
}
Weirdly this hides both <span>Large</span>
and the span further down (highlighted in the below image) which is the one which needs to stay. I need a way to work around this and remove the first span only, CSS or jS/jQuery options are all okay.
Interested in solutions as well as whether this is a known bug with select2?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
RE 一种解决方法,使用 jQuery:
RE a workaround, working with jQuery: