我有一个表,并希望第一列有一个垂直滚动条.这适用于Chrome,IE9,iPad上的Safari但不适用于Firefox?为什么不?我究竟做错了什么?
HTML:
<table> <tbody> <tr> <td class="col1"> <div class="wrapper"> <p>Test</p> <p>Test</p> <p>Test</p> <p>Test</p> <p>Test</p> <p>Test</p> ... </div> </td> <td class="col2"> </td> </tr> </tbody> </table>
CSS:
html,body { margin: 0; padding: 0; height: 100%; width: 100%; } table { width: 100%; height: 100%; } table .col1 { width: 20%; height: 100%; } table .col1>div.wrapper { width: 100%; height: 100%; overflow: auto; } table .col2 { width: 80%; height: 100%; background-color: red; }
解决方法
问题:
溢出:滚动;不会在桌子内工作.
如果你对div做同样的事情,那么它会正常工作.
例:
HTML
<div class="col1" > <div class="wrapper"> <p>Test</p> <p>Test</p> <p>Test</p> <p>Test</p> <p>Test</p> ... </div> </div><div class="col2"> </div>
更多内容:http://lists.w3.org/Archives/Public/www-style/2006Mar/0030.html#replies
感谢kirtan