css隐藏按钮直到div悬停
We want to hide button until we hover over the div layer.
FIDDLE here > Click to view
Essentially, I would like to be able to apply this to other elements also, but this will do for now, any help appreciated
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
只需在外部 div 上使用
:hover
伪类:这是小提琴: http://jsfiddle.net /dTLaF/1/
Simply use the
:hover
pseudo-class on the outer div:Here's the fiddle: http://jsfiddle.net/dTLaF/1/
:hover
父级上的伪选择器。不过,对于后代来说,当问题的代码包含在问题中时,这很好。:hover
pseudoselector on the parent. Though it's nice when the code for the question is included in the question, for posterity.当使用此功能并尝试悬停时,大多数情况下它不起作用,因为当某些内容被隐藏时,它不再可以激活悬停,解决此问题的最简单方法是使其透明并使用悬停来删除透明度。
when using this feature and trying to hover most of the time it doesn't work because when something is hidden it is no longer there to activate hover, the simplest way to solve this is by making it transparent and using hover to remove the transparency.