我想並排對齊兩個div - 一個div包含圖像,另一個包含有關圖像中人物的文本(即配置文件),我無法確定儘管如何讓div排列在一起,但我嘗試過漂浮和使用表格單元顯示,並且它似乎永遠不會粘住。也許別人可以爲我解決這個問題?問題並排對齊兩個div
HTML
<div id="tai-prof">
<div class="prof-content">
<div class="picture">
<img src="http://i.imgur.com/BXgeNF3.png">
</div>
<div class="profile">
<div class="prof-desc">
<h2>Name</h2>
<h2 class="desc">Description</h2>
<h2 class="email">email (maybe)</h2>
<span class="prof-bio">But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally</span>
<span class="sites"> <a href="#">www.mysite.com</a> | <a href="#">www.mypage.com</a> | <a href="#">my blog</a>
</span>
</div>
</div>
</div>
</div>
CSS
.prof-content, .profile {
float: left;
}
.prof-content .picture {
float: left;
}
.prof-content .picture img {
width: 45%;
}
.prof-content .prof-desc {
display: table-cell;
/*position: relative;
left: -25%;*/
}
請澄清什麼是你想要的結果。你想讓所有的描述位於圖像右側的區域嗎?即'picture'和'profile'是並排的? '排隊'是什麼意思?垂直?水平? – frozenkoi
@frozenkoi抱歉,如果它不清楚,但是,我希望圖片和整個說明是一邊按大小(水平) –
類似(如果不重複)與圖片問題(誰不喜歡的圖片?):http:/ /stackoverflow.com/questions/5943166/vertical-alignment-of-text-in-a-table-cell – frozenkoi