溢出列表里面的一个div溢出:隐藏 [英] Overflow a list inside a div of which overflow:hidden
问题描述
我有一个div,div的高度为200px。在div里面有文本,我不想让div有滚动条,因此我设置了overflow:hidden。
I have a div and that div has a height of 200px. Inside the div there is text and I don't want the div to have scrollbars therefore I've set overflow:hidden.
现在,在div里面还有一个一个列表,充当一个下拉框。当你点击列表/下拉框,我想要它的主要div的TOP。
Now, inside that div there is a also a list, acting as a dropdown box. When you click on the list/dropdown box, I want it to come on TOP of the main div.
这是一个主要div溢出的示例:hidden:
Here is an example with the main div to overflow:hidden:
这是一个没有overflow:hidden的例子。所以我想要以下内容,但文字不会溢出。
And this is an example without overflow:hidden. So I want the following but the text not overflowing.
jsFiddle: http:// jsfiddle.net/w8kQA/
jsFiddle: http://jsfiddle.net/w8kQA/
推荐答案
您可以在框中的元素上设置overflow:的盒子本身:
You could set the overflow:hidden on the element inside the box, instead of on the box itself:
http:// jsfiddle .net / w8kQA / 1 /
这篇关于溢出列表里面的一个div溢出:隐藏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!