Bootstrap 5 Images Thumbnails
Last Updated :
18 Nov, 2022
Bootstrap 5 Images thumbnails are used to add a 1px rounded border around the image. A thumbnail is a small size image that represents a larger image.
Images thumbnails used Class:
- .img-thumbnail: This class is used to create the thumbnail image. This class adds 1px rounded border to the image.
Syntax:
<img src="..." class="img-thumbnail" alt="...">
Example 1: In this example, we will use .img-thumbnail class to create a thumbnail image.
HTML
<!DOCTYPE html>
< html >
< head >
< title >Bootstrap 5 Images Thumbnails</ title >
rel = "stylesheet"
integrity = "sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC"
crossorigin = "anonymous" >
integrity = "sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
crossorigin = "anonymous" >
</ script >
</ head >
< body >
< div class = "container text-center" >
< h1 class = "text-success" >
GeeksforGeeks
</ h1 >
< h2 >Bootstrap 5 Images Thumbnails</ h2 >
< img src =
class = "img-thumbnail" alt = "GFG" >
</ div >
</ body >
</ html >
|
Output:
Example 2: In this example, we will use .img-thumbnail and .rounded-circle classes to create a thumbnail of rounded image.
HTML
<!DOCTYPE html>
< html >
< head >
< title >Bootstrap 5 Images Thumbnails</ title >
rel = "stylesheet"
integrity = "sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC"
crossorigin = "anonymous" >
integrity = "sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
crossorigin = "anonymous" >
</ script >
</ head >
< body >
< div class = "container text-center" >
< h1 class = "text-success" >
GeeksforGeeks
</ h1 >
< h2 >Bootstrap 5 Images Thumbnails</ h2 >
< img src =
class = "img-thumbnail rounded-circle" alt = "GFG" >
</ div >
</ body >
</ html >
|
Output:
Reference: https://getbootstrap.com/docs/5.0/content/images/#image-thumbnails
Share your thoughts in the comments
Please Login to comment...