Dub*_*one 3 html css twitter-bootstrap twitter-bootstrap-4 bootstrap-4
我已经成功地将一行文本与图像(小提琴)对齐.
<div class="profile-details-wrapper">
<img class="profile-picture" src="http://placehold.it/50x50" />
<span class="profile-details">
username
</span>
</div>
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试添加另一行文本时,它会包裹在图像下(小提琴).
<div class="profile-details-wrapper">
<img class="profile-picture" src="http://placehold.it/50x50" />
<span class="profile-details">
username
<br />
username
</span>
</div>
Run Code Online (Sandbox Code Playgroud)
如何使多行文本超出旁边图像的高度,但不会在其下面换行?
奖金问题:我如何垂直对齐呢?
建立在@ freestock.tk的表格示例上..
.profile-details-wrapper { display: table-row; }
.profile-picture {
display: table-cell;
vertical-align: top;
margin-right: 10px;
}
.profile-details { display: table-cell; vertical-align: top; }Run Code Online (Sandbox Code Playgroud)
<div class="profile-details-wrapper">
<img class="profile-picture" src="http://placehold.it/50x50">
<div class="profile-details">
text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here text here
</div>
</div>Run Code Online (Sandbox Code Playgroud)