这里是我的代码:如何设置表格单元格的方向?
.table {
display: table;
width: 100%;
}
.table > div {
display: table-cell;
border: 1px solid red;
}
.container{
background-color: #e0eaf1;
width: 160px;
}
.author a, .editor a{
font-size: 12px;
}
.author b, .editor b{
font-size: 12px;
}
<div class="table">
<div class="share_edit_flag">
<span>share</span>
<span>edit</span>
<span>delete</span>
</div>
<div class="editor">
<div class="container">
<a href="#">edited May 21 16 at 11:58</a>
<div class="profile">
<a href="#">Rory O'Kane</a>
<b>12.6k</b>
<!-- I don't have any badge in my website -->
</div>
</div>
</div>
<div class="author">
<div class="container">
<a href="#">asked May 21 16 at 11:51</a>
<div class="profile">
<a href="#">vasanthkumarmani</a>
<b>1</b>
<!-- I don't have any badge in my website -->
</div>
</div>
</div>
</div>
我想设置.container
箱表中的单元格的右侧。我怎样才能做到这一点?
当我将float: right
设置为.container
时,它也会影响.share_edit_flag
元素并使其损坏。
'的text-align:right' – zer00ne
使用CSS Flexbox的 – charlietfl
@ zer00ne [行不通](https://jsfiddle.net/f7ymg3Lj /) – stack