我想根据其父类的左边,右边或中心对齐父级Div下的子Div。Left,Right和Center Align Div div下的子div div
我也做了以下
.container{
border:1px solid;
padding:1px;
width:100%;
margin:1px;
}
.left-item{
float:left;
padding:auto;
margin:1px;
}
.center-item{
padding:auto;
margin:1px;
}
.right-item{
float:right;
padding:auto;
margin:1px;
}
<div class="container">
<button class="left-item">Left</button> <button class="center-item">Center 2</button> <button class="right-item">Right</button> <button class="left-item">Left</button> <button class="right-item">Right</button> <button class="center-item">Center 1</button> <button class="center-item">Center 3</button>
</div>
我无法对齐child Divs
居中于母公司Divs
。谁能帮我这个?
尝试'浮动:在中心项目left'太 –
你疯了...... @PrasunJajodia – Darshak