如何在图像的右下角放置Bootstrap badge?如何在bootstrap中将img放在img的右下角?
我发现this related question将引导徽章放置在媒体图像的角落,但无法将其转换为在没有非媒体图像的情况下工作。
编辑:对缺乏细节的道歉。这是一个fiddle的例子。
我的目标是让图像在彼此相邻的同一行上,以及图像右下角的徽章。
例子:
<div class="image_with_badge_container">
<img src="http://placehold.it/64x64" />
<span class="badge img-badge">2</span>
</div>
<div class="image_with_badge_container">
<img src="http://placehold.it/64x64" />
<span class="badge img-badge">4</span>
</div>
<div class="image_with_badge_container">
<img src="http://placehold.it/64x64" />
<span class="badge img-badge">5</span>
</div>
CSS:
.image_with_badge_container {
/*?*/
}
.img-badge {
/*?*/
}
你能提供代码或者您想要放置徽章 –
的示例,您需要自定义CSS .btn .badge {0} {0} {0} {0} border:1px solid #ccc; 位置:相对; right:-20px; top:15px; } –
@kindly通过提琴提供代码将有助于解决您的问题 – Mahadevan