CSS:如何在一行中设置多个 div,宽度为 100%?

Ant*_*ony 2 html css css-float

类似的问题在这里,但我的 div 根本没有固定大小。我需要遵循结构:

<div style="float:left;"></div>
<div style="float:left;"></div> <!-- this div should be what's left after the first and third divs -->
<div style="float:right;"></div>
Run Code Online (Sandbox Code Playgroud)

我试图overflow:hidden;为第二个 div设置 ,但它没有帮助。

san*_*eep 5

您可以像这样组合white-space&来实现display:inline-block

HTML:

<div class="parent">
    <div class="child">1</div>
    <div class="child">2</div>
    <div class="child">2</div>
</div>
Run Code Online (Sandbox Code Playgroud)

CSS:

.child{
    display:inline-block;
    *display:inline; /* for IE7*/
    *zoom:1;/* for IE7*/
    min-width:100px;
    min-height:50px;
    margin-right:10px;
    background:red;
    white-space:normal;
}
.parent{
    white-space:nowrap;
}
Run Code Online (Sandbox Code Playgroud)

http://jsfiddle.net/QdvFp/1/