是否可以在 IE8 中使用表格(仅使用CSS和div,不使用Javascript)复制完全此布局:
http://jsfiddle.net/u0u7snh6/2/
我尝试过多种情况, IE8 似乎要么搞乱了:
完全这个词在这里非常重要......除此布局之外的任何内容都不起作用, IE8 是强制性的。
否则,2014年使用表格进行布局是否很重要?
以下是简单的代码:
HTML
<body>
<table id="contentFrame">
<tr style="background-color: pink;">
<td> </td>
<td id="contentCol">
This is the header
</td>
<td> </td>
</tr>
<tr id="contentRow">
<td></td>
<td id="contentCell">
This is the content
</td>
<td></td>
</tr>
<tr style="background-color: yellow;">
<td></td>
<td>
This is the footer
</td>
<td></td>
</tr>
</table>
</body>
CSS
html, body {
height: 100%;
margin: 0;
padding: 0;
}
#contentFrame {
width: 100%;
height: 100%;
border-spacing: 0;
border-collapse: collapse;
empty-cells: show;
}
#contentRow {
background-color: green;
}
#contentCell {
height: 100%;
vertical-align: middle;
background-color: white;
}
#contentCol {
width: 80%;
}