Add style to images with Bootstrap



The following classes are provided by Bootstrap to add style to images:

  •  .img-rounded − adds border-radius:6px to give the image rounded corners.
  •  .img-circle − makes the entire image round by adding border-radius:500px.
  •  .img-thumbnail − adds a bit of padding and a gray border

You can try to run the following code to add style to images

Example

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <title>Bootstrap Images</title>
      <link href="/https/www.tutorialspoint.com/bootstrap/css/bootstrap.min.css" rel = "stylesheet">
      <script src = "/scripts/jquery.min.js"></script>
      <script src = "/bootstrap/js/bootstrap.min.js"></script>
   </head>
   <body>
      <p>Styling images with Bootstrap</p>
      <img src = "/bootstrap/images/download.png" class = "img-rounded">
      <img src = "/bootstrap/images/download.png" class = "img-circle">
      <img src = "/bootstrap/images/download.png" class = "img-thumbnail">
   </body>
</html>
Updated on: 2020-06-12T14:41:30+05:30

693 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements