我有一个:
.itembox {
类,其中显示目录类型网站中的许多元素。我认为在特定高度 overflow:hidden
会很酷,并且下面有一个小的 1px solid #AAA
,然后当悬停在 > 它显示完整. 使用我的全局类是否相当简单?
最佳答案
这非常微不足道。添加 max-height
以及您的 overflow:hidden
,然后在类的 :hover
版本上删除 max-高度
(通过将其设置为非常高的数字)。
.itembox {
max-height: 200px;
overflow: hidden;
border-bottom: 1px solid #aaa;
}
.itembox:hover {
max-height: 9999px;
}
关于css - 溢出 :hidden at a certain height > on hover displays all?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10423909/