我有一個沒有設置寬度的容器div,它包含一個可變寬度的表格,並且還有一個表格下方的按鈕。我想讓這個按鈕漂浮在右邊,使其右邊緣與桌子右邊緣對齊。 做下面的事情似乎在所有瀏覽器中都能正常工作,但IE < = 7。這是如何正確完成的?在IE中包含具有可變寬度的父元素的右側元素<= 7
<head>
<style>
#tableContainer {
float: left;
}
#btn {
float: right;
}
</style>
</head>
<body>
<div id="tableContainer">
<table>
<tr>
<td>a b c</td>
<td>a b c</td>
<td>a b c</td>
<td>a b c</td>
</tr>
</table>
<button id="btn">buttontext</button>
</div>
</body>
</html>
這裏有我想要的一個例證:
__________________
| |
| table |
|________________|
|btn|
‾‾‾‾‾
不知道你讓我對的,但我已經添加插圖的問題等等你可以看到我在做什麼 – Clox 2013-04-05 05:29:23