这是我的代码(请参阅this fiddle):
HTML
<div id="container">
<span id="left">Left text</span>
<span id="middle">Very very very very very long middle text.</span>
<span id="right">Right text</span>
</div>
CSS
#container {
white-space: nowrap;
position: relative;
}
#left {
border: solid 1px red;
}
#middle {
border: solid 1px green;
}
#right {
border: solid 1px blue;
position: absolute;
right: 0px;
}
我希望#middle
的宽度随着窗口变小而缩小,以免与#right
发生冲突。
答案 0 :(得分:1)
答案 1 :(得分:0)