顯式地從正確的內容中分離左側內容:user-photo |用戶信息。
申請保證金左:寬度(。用戶-照片)+一些PX
讓.title僞display: table
See example in Fiddle
HTML:
<div class="user-photo"></div>
<div class="user-info">
<div class="title">
<h3 class="pull-left">User name</h3>
<h3 class="pull-right">11.02.2014</h3>
</div>
<div class="body">
Aenean vel ornare sapien. Suspendisse cursus pulvinar mattis. Donec magna odio, feugiat sed blandit vitae, fermentum eget ante. In iaculis nulla pretium malesuada porttitor. Ut adipiscing purus at pulvinar ultricies. Vestibulum lacinia erat felis, vitae faucibus justo dictum quis. Proin at erat ut turpis mollis aliquet. Aenean ornare nunc non elit sodales bibendum. Donec ac blandit turpis. Nunc faucibus in sapien in vehicula. Sed quam arcu, bibendum in imperdiet consequat, suscipit quis metus. In non est porttitor, adipiscing justo vitae, tempus nisi.
</div>
</div>
DIFF CSS:
.comment .user-info {
margin-left: 120px;
}
.comment .title {
display: table;
width: 100%;
}
它幾乎奏效。看看我有什麼:http://oi58.tinypic.com/zn1uuo.jpg。問題是評論文字也浮動評論標題或種類。我嘗試添加邊距,但效果不好: – Victor