【发布时间】:2021-01-15 01:10:34
【问题描述】:
我想设置三个 div 一个左侧和另外两个左侧但float: right; 不解决我的问题。我正在尝试流动的代码。
.container .A {
float:left;
width:100px;
height: 80px;
background: lightskyblue;
}
.container .B {
float:right;
width:100px;
height: 80px;
background: lightgreen;
}
.container .C {
float:right;
width:100px;
height: 80px;
background: hotpink;
}
<div class="container">
<div class="A">A</div>
<div class="B">B</div>
<div class="C">C </div>
</div>
【问题讨论】:
-
使用弹性和媒体查询。这会容易得多,而且没有副作用。