我在下面有 HTML 标记。我需要将包含表格的 div 的大小减半,所以基本上溢出:隐藏并且只显示包含在指定大小内的 div 的一部分。但是,包含 div 的 height 属性并未应用于表格。
<html>
<head>
<title>Test</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<style type="text/css">
.temp{
height: 20px;
}
</style>
</head>
<body>
<div class="temp">
<table border="1">
<tr>
<td>This is a test.</td>
<td>Do you see what I mean?</td>
<td>I hate this overflow.</td>
</tr>
</table>
</div>
</body>
</html>