YouTip LogoYouTip

Bootstrap4 Media Objects

# Bootstrap4 Media Objects Bootstrap provides an excellent way to handle the layout of media objects (images or videos) alongside content. Common use cases include blog comments, social media posts, etc. ## Basic Media Object To create a media object, add the `.media` class to a container element. Then, place the media content inside a child container with the `.media-body` class. You can then add margins, padding, and other effects: ## Example
John Doe

Tutorial

Learning is not just about technology, but also about dreams!!!

[Try it Β»](#) * * * ## Nested Media Objects Media objects can be nested (one media object inside another). To nest a media object, place the new `.media` container inside the `.media-body` container: ## Example
John Doe

Tutorial

Learning is not just about technology, but also about dreams!!!

Jane Doe

Tutorial

Learning is not just about technology, but also about dreams!!!

[Try it Β»](#) * * * ## Media Object Image on the Right If you want the avatar image to appear on the right side, place the image after the `.media-body` container: ## Example

Tutorial

Learning is not just about technology, but also about dreams!!!

John Doe
[Try it Β»](#) * * * ## Aligning Media Object Images We can use the `align-self-*` utility classes to set the vertical alignment of the media object's image: ## Example

Top Aligned -- Tutorial

Learning is not just about technology, but also about dreams!!!

Center Aligned -- Tutorial

Learning is not just about technology, but also about dreams!!!

Bottom Aligned -- Tutorial

Learning is not just about technology, but also about dreams!!!

[Try it Β»](#)
← Java9 Module SystemMet Console Warn β†’