<div id="firstRow">
<div id="one">AAA</div>
<div id="two"><input style="width: 100%" type="search"></div>
<div id="three">AAAAAA</div>
</div>
我有三个div
s。连续三个div CSS
- 我想漂浮
div
与idone
到左边。div
的宽度取决于其内容。 - 我想浮动
div
三个右边的自动宽度也取决于其内容。 - 我想用id为2的
div
来占用所有剩余的空间。
我与表造的,但是我希望它与div
小号
<table>
<tr>
<td id="one">AAAAAAAAAAAAAAAAAAAAA</td>
<td id="two"><input style="width: 100%" type="search"></td>
<td id="three">AAAAAA</td>
</tr>
</table>
table {
width: 100%;
}
#one
width: auto;
height: 20px;
background-color: red;
}
#two{
width: 100%;
height: 20px;
background-color: orange;
}
#three {
width: auto;
height: 20px;
background-color: green;
}
相关:http://stackoverflow.com/q/2603700/3597276 –
在我看来雷纳德的Flexbox的答案是要走的路。 –