<!DOCTYPE html> <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <style> *{ margin:0px; padding: 0px; } html{ width:100%; height:100%; } body{ width:100%; height:100%; } .testTable{ table-layout: fixed; border-collapse:collapse; width:400px; height: 400px; border:1px solid blue; } .testTable td{ border:1px solid blue; } .testTable td.testTd { position: relative; } .testDiv{ width:100%; height:100px; position: absolute; bottom: 0px; background: red; } </style> <script> </script> </head> <body > <table class='testTable'> <tr> <td class='testTd'> <div class='testDiv'></div> </td> </tr> <tr> <td> </td> </tr> </table> </body> </html>
运行代码
firefox22下红争部分竟然以窗口做基准计算!