问题描述
我有一个非常基本的css问题。
我有一个固定高度的div,我有一个表里面的div。
I have a very basic css question.I have a div with fixed height and I have a table inside that div.
表的内容将不适合div,除非div滚动条。现在的问题是,
表的内容溢出div,因为它的高度大于我在div上设置的高度。
The content of the table will not fit in the div unless the div gets a scrollbar. The problem is now,the content of the table is overflowing the div as its height is more than the height I set on the div.
这是什么我有Div
display: inline-block;
float: left;
max-height: 200px;
以下是一个示例。
a href =http://jsfiddle.net/LNS26/58/ =nofollow> jsfiddle
jsfiddle
如何获取表格适合在div和有滚动条?这不是特定于任何浏览器。
How do I get the table to fit in the div and have a scrollbar? This is not specific to any browser. I tried both in Chrome and IE myself.
推荐答案
[编辑]引用您的请求: p>
[edit] Quoting your request:
将以下内容添加到 .test
()
overflow-y:scroll;
这篇关于表里面的div溢出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!