<div id="leftdiv" style="background: yellow; min-width: 400px; max-width: 800px;">left content left content left content</div>
<div id="rightdiv" style="background: red; width: 250px;">right content right content right content</div>
我将 float: left
放在左边的 div max-width 和 min-width 不起作用。
我该如何解决这个问题?
最佳答案
向右浮动的 div 必须在向左浮动之前,因为它在某些版本的 ie 中会带来麻烦
<div id="rightdiv" >right content right content right content</div>
<div id="leftdiv">left content left content left content</div>
CSS 与机器人相同
#leftdiv
{
background-color:Yellow;
min-width:100%;
max-width:800px;
float:left;
}
#rightdiv
{
background-color:red;
width:250px;
float:right;
}
关于css - 左右两个 div,自动宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16660736/