1
我想居中一個div
元素,並將另一個div
元素置於右側,並具有相同的垂直對齊。我不知道如何在不將兩個元素集中的情況下繼續下去。定位兩個div元素,其中一個居中
這是我的代碼。
<div class="container">
<div class="center"></div>
<div class="right"></div>
</div>
.center {
width: 100px;
height: 100px;
margin: auto;
background-color: red;
}
.right {
width: 100px;
height: 100px;
background-color: blue;
}