我有一个引导面板,其中包含两个图像以及要放在同一行的文本。 display:inline-block;
和display:inline;
并没有像他们倾向于的那样进行救援。
<div class="panel panel-default">
<div class="panel-heading"><b>Owner</b></div>
<div class="panel-body" id="owners">
<img src="http://cdn.akamai.steamstatic.com/steamcommunity/public/images/avatars/40/405b7b5da64cc1dbcb68110ca5e65a9c751b79a0_full.jpg" height="64"><h4>Firav</h4>
<img src="http://cdn.akamai.steamstatic.com/steamcommunity/public/images/avatars/66/66cd4ded6f8bc2761f64c110ff8f8b93e568082e_full.jpg" height="64"><h4>Donnyy</h4>
</div>
</div>
<br>
最佳答案
您可以尝试这样-
.panel-body figure{display:inline-block;}
<div class="panel panel-default">
<div class="panel-heading"><b>Owner</b></div>
<div class="panel-body" id="owners">
<figure>
<img src="http://cdn.akamai.steamstatic.com/steamcommunity/public/images/avatars/40/405b7b5da64cc1dbcb68110ca5e65a9c751b79a0_full.jpg" height="64"><h4>Firav</h4>
</figure>
<figure>
<img src="http://cdn.akamai.steamstatic.com/steamcommunity/public/images/avatars/66/66cd4ded6f8bc2761f64c110ff8f8b93e568082e_full.jpg" height="64"><h4>Donnyy</h4>
</figure>
</div>
</div>
关于html - 在引导面板内的同一行上对齐两个图像和标题,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/34431624/