我有一个DIV,使用text-align: center;
来使所有子元素居中对齐,但是我想让其中一个子元素靠左对齐,同时保持其他元素居中对齐。
我该如何实现这个效果?
我尝试将该元素左浮动,但这会破坏我的设计,因为我根本没有使用浮动。
.parent {
text-align: center;
margin-bottom: 15px;
margin-top: 8px;
}
.child (I want to align this one left) {
display: inline-block;
font-family: 'Source Sans Bold', Helvetica neue, verdana, arial;
font-size: 16px;
background-color: #5a8da3;
padding: 4px;
}