这是一个演示:
<div>
<div>
在拖动预览中不可见
.absolute {
position: absolute;
}
.draggable {
position: relative;
height: 60px;
border: 1px solid #CCC;
margin: 10px;
}
.draggable div {
height: 40px;
width: 40px;
}
.left {
background-color: blue;
}
.right {
background-color: red;
}
.left.absolute {
top: 10px;
left: 10px;
}
.right.absolute {
top: 10px;
right: 10px;
}
.right.float {
float: right;
margin: 10px;
}
.left.float {
margin: 10px;
float: left;
}
<!-- Expected behavior -->
<div class="draggable" draggable="true">
<div class="left float"> </div>
<div class="right float"> </div>
</div>
<!-- Bug -->
<div class="draggable" draggable="true">
<div class="left absolute"> </div>
<div class="right absolute"> </div>
</div>