爲什麼html元素如果他們不打算遵循它,就有max-height屬性。例如,我有表:html元素的設置高度不起作用
<table border="2" style="table-layout:fixed; max-height:20px;">
<tr style="height:20px;">
<td style="overflow:hidden; max-height:20px; overflow:hidden;">
<img id="book" src="img/capture.png" alt="" style="position:relative; margin-top:0px;" />
</td>
</tr>
</table>
,如果IMG恰好有一個高度超過20像素的錶行的高度將不等於20像素大。我該如何告訴html我希望表格行的高度爲20px?
編輯:
我知道我可以改變img的高度,但我不想扭曲IMG。