2
我使用Bootstrap,我想在同一列中將圖像和表「並排」對齊。HTML5 - 水平對齊圖像和表內聯
HTML代碼:
<div class="col-md-10" style="width: 100%">
<img src="#" class="img-responsive pull-left pro-page-pro-image">
<div class="container">
<table class="table table-responsive pull-right pro-page-contact-details-table">
<tbody>
<!---the table has 12 rows in total -->
<tr>
<td>MEMBER SINCE</td>
<td>2007</td>
</tr>
<tr>
<td>Suburb</td>
<td>Fourways, Randburg</td>
</tr>
</tbody>
</table>
</div>
</div>
相關的CSS:
.pro-page-pro-image {
display:inline;
margin-top: 4%;
margin-left: 11%;
margin-right: 11%;
margin-bottom: 4%;
}
.pro-page-contact-details-table {
display: inline;
}
的類.table
和.table-responsive
是標準的自舉類。目前在瀏覽器中,表格直接位於圖像的下方(均左對齊),儘管嘗試了許多事情,但我無法讓它們並排排列。
任何指針將不勝感激。
謝謝H.布蘭丹你的建議已經解決了我的問題。讚賞。 –
歡迎您:D –