
- Bootstrap Tutorial
- Bootstrap - Home
- Bootstrap - Overview
- Bootstrap - Environment Setup
- Bootstrap with CSS
- Bootstrap - Grid System
- Bootstrap - CSS Overview
- Bootstrap - Typography
- Bootstrap - Code
- Bootstrap - Tables
- Bootstrap - Forms
- Bootstrap - Buttons
- Bootstrap - Images
- Bootstrap - Helper Classes
- Bootstrap - Responsive utilities
- Bootstrap Layout Components
- Bootstrap - Glyphicons
- Bootstrap - Dropdowns
- Bootstrap - Button Groups
- Bootstrap - Button Dropdowns
- Bootstrap - Input Groups
- Bootstrap - Navigation Elements
- Bootstrap - Navbar
- Bootstrap - Breadcrumb
- Bootstrap - Pagination
- Bootstrap - Labels
- Bootstrap - Badges
- Bootstrap - Jumbotron
- Bootstrap - Page Header
- Bootstrap - Thumbnails
- Bootstrap - Alerts
- Bootstrap - Progress Bars
- Bootstrap - Media Object
- Bootstrap - List Group
- Bootstrap - Panels
- Bootstrap - Wells
- Bootstrap Plugins
- Bootstrap - Plugins Overview
- Bootstrap - Transition Plugin
- Bootstrap - Modal Plugin
- Bootstrap - Dropdown Plugin
- Bootstrap - Scrollspy Plugin
- Bootstrap - Tab Plugin
- Bootstrap - Tooltip Plugin
- Bootstrap - Popover Plugin
- Bootstrap - Alert Plugin
- Bootstrap - Button Plugin
- Bootstrap - Collapse Plugin
- Bootstrap - Carousel Plugin
- Bootstrap - Affix Plugin
- Bootstrap Demos
- Bootstrap - Grid Demo
- Bootstrap - Table Demo
- Bootstrap - Form Demo
- Bootstrap - Buttons Demo
- Bootstrap - Images Demo
- Bootstrap - Responsive Demo
- Bootstrap - Navigation Demo
- Bootstrap - Blog Demo
- Bootstrap - Material Design Demo
- Bootstrap - Slider Demo
- Bootstrap - Time line Demo
- Bootstrap - Alert Demo
- Bootstrap - Admin Interface Demo
- Bootstrap - Ajax Demo
- Bootstrap - Tabbed slider Demo
- Bootstrap - Caption Demo
- Bootstrap - Map Demo
- Bootstrap - Calendar Demo
- Bootstrap - Social Icons Demo
- Bootstrap - Icons Demo
- Bootstrap - featured Demo
- Bootstrap Useful Resources
- Bootstrap - Questions and Answers
- Bootstrap - Quick Guide
- Bootstrap - Useful Resources
- Bootstrap - Discussion
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Bootstrap - Media Object
This chapter discusses about Media object. These are abstract object styles for building various types of components (like blog comments, Tweets, etc.) that feature a left-aligned or right-aligned image alongside the textual content. The goal of the media object is to make the code for developing these blocks of information drastically shorter.
The goal of media objects (light markup, easy extendability) is achieved by applying classes to some of the simple markup. There are two forms to the media object −
.media − This class allows to float a media object (images, video, and audio) to the left or right of a content block.
.media-list − If you are preparing a list where the items will be part of an unordered list, use a class. useful for comment threads or articles lists.
Let us see an example below of default media object −
<div class = "media"> <a class = "pull-left" href = "#"> <img class = "media-object" src = "/bootstrap/images/64.jpg" alt = "Media Object"> </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 = "/bootstrap/images/64.jpg" alt = "Media Object"> </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 = "/bootstrap/images/64.jpg" alt = "Media Object"> </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>
Let us see an example of media list −
<ul class = "media-list"> <li class = "media"> <a class = "pull-left" href = "#"> <img class = "media-object" src = "/bootstrap/images/64.jpg" alt = "Generic placeholder image"> </a> <div class = "media-body"> <h4 class = "media-heading">Media heading</h4> <p> 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. </p> <!-- Nested media object --> <div class = "media"> <a class = "pull-left" href = "#"> <img class = "media-object" src = "/bootstrap/images/64.jpg" alt = "Generic placeholder image"> </a> <div class = "media-body"> <h4 class = "media-heading">Nested 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. <!-- Nested media object --> <div class = "media"> <a class = "pull-left" href = "#"> <img class = "media-object" src = "/bootstrap/images/64.jpg" alt = "Generic placeholder image"> </a> <div class = "media-body"> <h4 class = "media-heading">Nested 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> <!-- Nested media object --> <div class = "media"> <a class = "pull-left" href = "#"> <img class = "media-object" src = "/bootstrap/images/64.jpg" alt = "Generic placeholder image"> </a> <div class = "media-body"> <h4 class = "media-heading">Nested 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> </li> <li class = "media"> <a class = "pull-right" href = "#"> <img class = "media-object" src = "/bootstrap/images/64.jpg" alt = "Generic placeholder image"> </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> </li> </ul>