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;
}