Make floated div fill remaining space

How can I make left div fill remaining space? In general, what I want to accomplish is to set right div to the right and fill remaining space with left div.

<div>
  <div id="left" style="float: left"></div>
  <div id="right" style="float: right; max-width: 700px"></div>
</div>

这是你想要的?

#container {
  display: flex;
  width: 100%;
}

#left {
  background-color: red;
  flex-grow: 1;
}

#right {
  max-width: 700px;
  background-color: blue;
}
<div id="container">
  <div id="left">
    Left left left
  </div>
  <div id="right">
    Right right right
  </div>
</div>
链接地址: http://www.djcxy.com/p/88278.html

上一篇: html正文小于其内容

下一篇: 使浮动div填充剩余空间