Alignment of Media Objects - HTML CSS Bootstrap

HTML CSS examples for Bootstrap:Media

Description

Alignment of Media Objects

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
 <head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Example of Bootstrap 3 Media Objects Alignment</title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
 </head><!-- www  .j av  a2  s .  com-->
 <body>
  <div>
   <div class="media">
    <div class="media-left">
     <a href="#"> <img src="https://www.java2s.com/style/demo/Firefox.png" class="media-object" alt="Sample Image"> </a>
    </div>
    <div class="media-body">
     <h4 class="media-heading">Top Aligned Media <small><i>This is Default</i></small></h4>
     <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam eu sem tempor, varius quam at, luctus dui. Mauris magna metus, dapibus nec turpis vel, semper malesuada ante.</p>
     <p>Vestibulum quis quam ut magna consequat faucibus. Pellentesque eget nisi a mi suscipit tincidunt. Ut tempus dictum risus. Pellentesque viverra sagittis quam at mattis.</p>
     <p>Amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.</p>
    </div>
   </div>
   <hr>
   <div class="media">
    <div class="media-left media-middle">
     <a href="#"> <img src="https://www.java2s.com/style/demo/Firefox.png" class="media-object" alt="Sample Image"> </a>
    </div>
    <div class="media-body">
     <h4 class="media-heading">Middle Aligned Media</h4>
     <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam eu sem tempor, varius quam at, luctus dui. Mauris magna metus, dapibus nec turpis vel, semper malesuada ante.</p>
     <p>Vestibulum quis quam ut magna consequat faucibus. Pellentesque eget nisi a mi suscipit tincidunt. Ut tempus dictum risus. Pellentesque viverra sagittis quam at mattis.</p>
     <p>Amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.</p>
    </div>
   </div>
   <hr>
   <div class="media">
    <div class="media-left media-bottom">
     <a href="#"> <img src="https://www.java2s.com/style/demo/Firefox.png" class="media-object" alt="Sample Image"> </a>
    </div>
    <div class="media-body">
     <h4 class="media-heading">Bottom Aligned Media</h4>
     <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam eu sem tempor, varius quam at, luctus dui. Mauris magna metus, dapibus nec turpis vel, semper malesuada ante.</p>
     <p>Vestibulum quis quam ut magna consequat faucibus. Pellentesque eget nisi a mi suscipit tincidunt. Ut tempus dictum risus. Pellentesque viverra sagittis quam at mattis.</p>
     <p>Amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.</p>
    </div>
   </div>
  </div>
 </body>
</html>

Related Tutorials