Bootstrap with CSS
- Bootstrap - Responsive utilities
- Bootstrap - Helper Classes
- Bootstrap - Images
- Bootstrap - Buttons
- Bootstrap - Forms
- Bootstrap - Tables
- Bootstrap - Code
- Bootstrap - Typography
- Bootstrap - CSS Overview
- Bootstrap - Grid System
Bootstrap Layout Components
- Bootstrap - Wells
- Bootstrap - Panels
- Bootstrap - List Group
- Bootstrap - Media Object
- Bootstrap - Progress Bars
- Bootstrap - Alerts
- Bootstrap - Thumbnails
- Bootstrap - Page Header
- Bootstrap - Jumbotron
- Bootstrap - Badges
- Bootstrap - Labels
- Bootstrap - Pagination
- Bootstrap - Breadcrumb
- Bootstrap - Navbar
- Bootstrap - Navigation Elements
- Bootstrap - Input Groups
- Bootstrap - Button Dropdowns
- Bootstrap - Button Groups
- Bootstrap - Dropdowns
- Bootstrap - Glyphicons
Bootstrap Plugins
- Bootstrap - Affix Plugin
- Bootstrap - Carousel Plugin
- Bootstrap - Collapse Plugin
- Bootstrap - Button Plugin
- Bootstrap - Alert Plugin
- Bootstrap - Popover Plugin
- Bootstrap - Tooltip Plugin
- Bootstrap - Tab Plugin
- Bootstrap - Scrollspy Plugin
- Bootstrap - Dropdown Plugin
- Bootstrap - Modal Plugin
- Bootstrap - Transition Plugin
- Bootstrap - Plugins Overview
Bootstrap Demos
- Bootstrap - featured Demo
- Bootstrap - Icons Demo
- Bootstrap - Social Icons Demo
- Bootstrap - Calendar Demo
- Bootstrap - Map Demo
- Bootstrap - Caption Demo
- Bootstrap - Tabbed slider Demo
- Bootstrap - Ajax Demo
- Bootstrap - Admin Interface Demo
- Bootstrap - Alert Demo
- Bootstrap - Time line Demo
- Bootstrap - Slider Demo
- Bootstrap - Material Design Demo
- Bootstrap - Blog Demo
- Bootstrap - Navigation Demo
- Bootstrap - Responsive Demo
- Bootstrap - Images Demo
- Bootstrap - Buttons Demo
- Bootstrap - Form Demo
- Bootstrap - Table Demo
- Bootstrap - Grid Demo
Bootstrap Useful Resources
- Bootstrap - Discussion
- Bootstrap - Useful Resources
- Bootstrap - Quick Guide
- Bootstrap - Questions and Answers
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Bootstrap - Thumbnails
This chapter discusses about Bootstrap thumbnails. A lot of sites need a way to lay out images, videos, text, etc, in a grid, and Bootstrap has an easy way to do this with thumbnails. To create thumbnails using Bootstrap −
Add an <a> tag with the class of .thumbnail around an image.
This adds four pixels of padding and a gray border.
On hover, an animated glow outpnes the image.
The following example demonstrates a default thumbnail −
<span class = "row"> <span class = "col-sm-6 col-md-3"> <a href = "#" class = "thumbnail"> <img src = "/bootstrap/images/kittens.jpg" alt = "Generic placeholder thumbnail"> </a> </span> <span class = "col-sm-6 col-md-3"> <a href = "#" class = "thumbnail"> <img src = "/bootstrap/images/kittens.jpg" alt = "Generic placeholder thumbnail"> </a> </span> <span class = "col-sm-6 col-md-3"> <a href = "#" class = "thumbnail"> <img src = "/bootstrap/images/kittens.jpg" alt = "Generic placeholder thumbnail"> </a> </span> <span class = "col-sm-6 col-md-3"> <a href = "#" class = "thumbnail"> <img src = "/bootstrap/images/kittens.jpg" alt = "Generic placeholder thumbnail"> </a> </span> </span>
Adding Custom Content
Now that we have a basic thumbnail, it s possible to add any kind of HTML content pke headings, paragraphs, or buttons into thumbnails. Follow the steps below −
Change the <a> tag that has a class of .thumbnail to a <span>.
Inside of that <span>, you can add anything you need. As this is a <span>, we can use the default span-based naming convention for sizing.
If you want to group multiple images, place them in an unordered pst, and each pst item will be floated to the left.
The following example demonstrates this −
<span class = "row"> <span class = "col-sm-6 col-md-3"> <span class = "thumbnail"> <img src = "/bootstrap/images/kittens.jpg" alt = "Generic placeholder thumbnail"> </span> <span class = "caption"> <h3>Thumbnail label</h3> <p>Some sample text. Some sample text.</p> <p> <a href = "#" class = "btn btn-primary" role = "button"> Button </a> <a href = "#" class = "btn btn-default" role = "button"> Button </a> </p> </span> </span> <span class = "col-sm-6 col-md-3"> <span class = "thumbnail"> <img src = "/bootstrap/images/kittens.jpg" alt = "Generic placeholder thumbnail"> </span> <span class = "caption"> <h3>Thumbnail label</h3> <p>Some sample text. Some sample text.</p> <p> <a href = "#" class = "btn btn-primary" role = "button"> Button </a> <a href = "#" class = "btn btn-default" role = "button"> Button </a> </p> </span> </span> <span class = "col-sm-6 col-md-3"> <span class = "thumbnail"> <img src = "/bootstrap/images/kittens.jpg" alt = "Generic placeholder thumbnail"> </span> <span class = "caption"> <h3>Thumbnail label</h3> <p>Some sample text. Some sample text.</p> <p> <a href = "#" class = "btn btn-primary" role = "button"> Button </a> <a href = "#" class = "btn btn-default" role =" button"> Button </a> </p> </span> </span> <span class = "col-sm-6 col-md-3"> <span class = "thumbnail"> <img src = "/bootstrap/images/kittens.jpg" alt = "Generic placeholder thumbnail"> </span> <span class = "caption"> <h3>Thumbnail label</h3> <p>Some sample text. Some sample text.</p> <p> <a href = "#" class = "btn btn-primary" role = "button"> Button </a> <a href = "#" class = "btn btn-default" role = "button"> Button </a> </p> </span> </span> </span>Advertisements