css - 溢出 :hidden at a certain height > on hover displays all?

标签 css

我有一个:

.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/

相关文章:

安卓有时花屏

javascript - 我如何从零开始设置按钮样式。摆脱按钮主题?

html - 设置 flexbox 元素的基线

css - ASP.NET MVC3 Razor - Html.ActionLink 样式

css - 我可以合并 :nth-child() or :nth-of-type() with an arbitrary selector? 吗

html - 使按钮在垂直方向上的位置相等

html - Sprite 在 IE 6、7、8 中无法正确显示

html - CSS3 Border-radius 创建一个蛋形

css - 无法定位最大宽度 360px

html - 如何让HTML表格中的<td>适合内容,让特定的<td>填充其余部分