這裏是我的代碼:如何設置表格單元格的方向?
.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