Usage of Bootstrap Media Objects


The media object is to make the code for developing blocks of information drastically shorter.

You can try to run the following code to implement media objects

Example

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <title>Bootstrap Example</title>
      <link href = "/bootstrap/css/bootstrap.min.css" rel = "stylesheet">
      <script src = "/scripts/jquery.min.js"></script>
      <script src = "/bootstrap/js/bootstrap.min.js"></script>
   </head>
   <body>
      <div class = "media">
         <a class = "pull-left" href = "#">
            <img class = "media-object" src = "https://www.tutorialspoint.com/sql/images/sql-mini-logo.jpg" alt = "SQL">
         </a>
         <div class = "media-body">
            <h4 class = "media-heading">Media heading</h4>
            This is some sample text. This is some sample text.
            This is some sample text. This is some sample text.
            This is some sample text. This is some sample text.
            This is some sample text. This is some sample text.
         </div>
      </div>
      <div class = "media">
         <a class = "pull-left" href = "#">
            <img class = "media-object" src = "https://www.tutorialspoint.com/sql/images/sql-mini-logo.jpg" alt = "SQL">
         </a>
         <div class = "media-body">
            <h4 class = "media-heading">Media heading</h4>
            This is some sample text. This is some sample text.
            This is some sample text. This is some sample text.
            This is some sample text. This is some sample text.
            This is some sample text. This is some sample text.
            <div class = "media">
               <a class = "pull-left" href = "#">
                  <img class = "media-object" src = "https://www.tutorialspoint.com/sql/images/sql-mini-logo.jpg" alt = "SQL">
               </a>
               <div class = "media-body">
                  <h4 class = "media-heading">Media heading</h4>
                  This is some sample text. This is some sample text.
                  This is some sample text. This is some sample text.
                  This is some sample text. This is some sample text.
                  This is some sample text. This is some sample text.
               </div>
            </div>
         </div>
      </div>
   </body>
</html>

Updated on: 12-Jun-2020

60 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements