我需要将两个 div 元素放在同一水平面上。按照我的做法,第二个会显示在第一个下面。我想以一种在过渡时相互交叉的方式放置它们。
编辑 1-当按下按钮交换他们的类时,div 上下移动。
#aaidi,#aaidi3 {
-webkit-transition: margin-left 1s ease-in-out;
-moz-transition: margin-left 1s ease-in-out;
-o-transition: margin-left 1s ease-in-out;
transition: margin-left 1s ease-in-out;
}
.left {
margin-left: 45%;
border: 1px solid green ;
width: 20px;
height: 4px;
background: #FF0000;
} // similar for right with margin-left:55%
......
<tr>
<td colspan=3>
<div id="aaidi" class="left">
</div>
<div id="aaidi3" class="right">
</div>
</td>
</tr> // after this there is a button pressing whom changes the class of both divs.