【发布时间】:2020-07-26 20:58:47
【问题描述】:
我正在使用 float 来对齐 3 个 div(左、中、右)。第一张照片显示了它的外观 on Google Chrome。第二张图片显示如何 它看起来 on Microsoft Edge 。浮动在 Google Chrome 上运行良好,当使用 Microsoft Edge 时,最后一个 div(right) 移动到左下容器。为什么会这样
* body,
p,
img {
margin: 0;
}
.container {
width: 900px;
border: 5px solid green;
padding: 3px;
margin: auto;
}
.left {
background-color: blueviolet;
width: 150px;
height: 300px;
line-height: 100px;
text-align: center;
float: left;
}
.center {
width: 600px;
height: 300px;
background-color: burlywood;
float: left;
}
.right {
width: 150px;
height: 300px;
background-color: coral;
float: left;
}
.clear {
clear: left;
}
<div class="container">
<div class="left"></div>
<div class="center"></div>
<div class="right"></div>
<div class="clear"></div>
</div>
【问题讨论】:
-
同一张图片的两倍
-
@Ifaruki 我编辑了一张图片
标签: css