所以這是我的演示:http://jsfiddle.net/3c40tafe/1/如何強制浮動塊留在CSS的同一行?
我怎樣才能使圖標,文件名和說明在同一行?同時,圖標和標題的寬度需要固定,並且描述段落充滿了休息寬度。
我的代碼:
<div class="item_row">
<div class="result_item_icon"><img src="img/logo/xmas_kitten.png"></div>
<div class="result_item_name">12 Kittens of Xmas</div>
<div class="search_result_description">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</div>
</div>
CSS:
.result_item_icon{
display:block;
float:left;
width:50px;
height:100%;
text-align: center;
}
.result_item_icon img{
max-width:50px;
max-height:50px;
}
.result_item_name{
display:block;
height:50px;
width:200px;
font-weight:700;
vertical-align: middle;
float;left
}
.search_result_description{
display:block;
float:left
}
很好的建議:像你想的表樣行爲的聲音,我!謝謝! – user3352464 2014-10-29 20:10:03