Media
Media was dropped in v5.x. This article is for v4.x.
The media object helps build complex and repetitive components where some media is positioned alongside content that doesn’t wrap around said media.
This is based on flex model, so you can align media vertically by align-self-start, align-self-center, align-self-end classes.
Media objects can be nested.
css class | description |
---|---|
media | Defines media object, that can contains media such <img>. Usually this is <div> or <li>element. In last case remove default list style by the list-unstyled class. |
media-body | Defines container for non-media content. |
-
Top-aligned media
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.
Donec sed odio dui. Nullam quis risus eget urna mollis ornare vel eu leo.
-
Center-aligned media
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.
Donec sed odio dui. Nullam quis risus eget urna mollis ornare vel eu leo.
-
Bottom-aligned media
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.
Donec sed odio dui. Nullam quis risus eget urna mollis ornare vel eu leo.