有没有办法显示仅当 中没有其他可见行时只使用CSS?
我知道使用 jQuery 显示和隐藏的能力;不幸的是,传递所有必要的参数是难以管理的,所以我正在寻找一个 CSS 技巧,它将使该行不可见,除非所有其他行都被隐藏。
我尝试使用 style="margin-bottom: -20px"
,但这没有效果。有这样的东西可以工作吗?
I'm aware of the ability to show and hide with jQuery; unfortunately, it would be unmanageable to pass around all the necessary parameters, so what I'm looking for is a CSS trick that will make the row invisible unless all the other rows are hidden.
I tried using a style="margin-bottom: -20px"
, but this had no effect. Is there something like this that would work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以显示一个元素,当且仅当它是其父元素的唯一子元素时,如下所示:
此不适用于 IE<9
You can show an element iff it's the only child of its parent like this:
This will not work on IE<9