使用下面的代码,CSS表格应该隐藏超过表格高度(200px)的内容。不幸的是,这不起作用,表格是垂直扩展的。有人知道为什么吗?
<div style='display:table; border:1px solid blue;
width:200px; table-layout:fixed; height: 200px'>
<div style='display:table-row'>
<div style='display:table-cell; overflow:hidden'>
contents<br/>contents<br/>contents<br/>contents<br/>contents<br/>
contents<br/>contents<br/>contents<br/>contents<br/>contents<br/>
contents<br/>contents<br/>contents<br/>
</div>
</div>
</div>
<div style='display:inline-block;width:20px;height:200px;
border:1px solid red; position:absolute;top:8px;left:220px'>
</div>感谢
发布于 2013-05-05 05:08:40
在我看来,您需要向divs添加一个class或ID。另外,如果您真的想创建表,通常不需要使用没有类或it的大量div。下面是关于如何在w3schools上制作表格的参考:http://www.w3schools.com/html/html_tables.asp
发布于 2013-05-05 05:11:35
用<div style="height: 200px;"> ... </div>包装所有东西
https://stackoverflow.com/questions/16378941
复制相似问题