Saved Bookmarks
| 1. |
Create an Image Thumbnail in Bootstrap |
|
Answer» Image thumbnail looks different from a regular image on a website. It has a gray border and PADDING, which MAKES it separate from other images. The following is an example that displays an image as a thumbnail in Bootstrap USING the img-thumbnail class: <!DOCTYPE html> <html lang="EN"> <head> <title>Bootstrap Thumbnail Image</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" HREF="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script> </head> <body> <div class="container"> <h2>Demo Image</h2> <p>The following image is a thumbnail image with gray border and padding.</p> <img class="img-thumbnail" src="https://d2o2utebsixu4k.cloudfront.net/media/images/7d7b2bef-2512-4a87-96cb-0bafd0da5048.jpg" alt="Chania" width="460" height="345"> </div> </body> </html>The output: |
|