Construct highly repetitive components like blog comments, tweets, and the like. Read the Official Bootstrap Documentation for a full list of instructions and other options.
Helps build complex and repetitive components where some media is positioned alongside content that doesn’t wrap around said media. Plus, it does this with only two required classes thanks to flexbox.
<div class="media">
<img src="..." class="wd-200 rounded mg-r-20" alt="">
<div class="media-body">
<h5 class="mg-b-15 tx-inverse">Media heading</h5>
Cras sit amet nibh libero, in gravida nulla...
</div>
</div>
Media objects can be infinitely nested, though we suggest you stop at some point. Place nested .media
within the .media-body
of a parent media object.
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.
<div class="media">
<img src="https://via.placeholder.com/640x426" class="wd-100 rounded mg-r-20" alt="">
<div class="media-body">
<h5 class="mg-b-15 tx-inverse">Media heading</h5>
<p>Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.</p>
<div class="media mg-t-25">...</div>
</div>
</div>
Media in a media object can be aligned with flexbox utilities to the top (default), middle, or end of your .media-body
content.
<div class="media">
<img src="..." class="wd-200 rounded mg-r-20 align-self-center" alt="">
<div class="media-body">...</div>
</div>
<div class="media">
<img src="..." class="wd-200 rounded mg-r-20 align-self-end" alt="">
<div class="media-body">...</div>
</div>
Change the order of content in media objects by modifying the HTML itself, or by adding some custom flexbox CSS to set the order property (to an integer of your choosing).
<div class="media">
<div class="media-body">...</div>
<img src="..." class="wd-200 rounded mg-l-20" alt="">
</div>
Because the media object has so few structural requirements, you can also use these classes on list HTML elements.
<ul class="list-unstyled">
<li class="media">...</li>
<li class="media mg-t-25">...</li>
<li class="media mg-t-25">...</li>
</ul>