WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

Bootstrap 4 - Images


Bootstrap provides instructions that can be used whilst operating with the img detail. Most of those are software classes that may be applied to any detail (no longer simply photos). However, there's a class particularly for responsive photographs.
  • .Img-rounded − You could make rounded corners to an photo with the aid of the usage of .Rounded elegance.

  • .Img-circle − You can make image as circle by way of the usage of .Rounded-circle elegance.

  • .Img-thumbnail − You could make photo as thumbnail (rounded 1 pixel border) by means of using .Img-thumbnail class.

The following example demonstrates utilization of above instructions to fashion an image −

Example

<html lang = "en">
   <head>
      <!-- Meta tags -->
      <meta charset = "utf-8">
      <meta name = "viewport" content = "width = tool-width, preliminary-scale = 1, reduce-to-match = no">
      
      <!-- Bootstrap CSS -->
      <link rel = "stylesheet" 
         href = "https://stackpath.Bootstrapcdn.Com/bootstrap/four.1.Three/css/bootstrap.Min.Css" 
         integrity = "sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" 
         crossorigin = "anonymous">
      
      <name>Bootstrap 4 Example</identify>
   </head>
   
   <frame>
      <div elegance = "container">
         <h2>Rounded Corners Image</h2>
         <img src = "https://www.Welookups.Com/bootstrap/snap shots/64.Jpg" 
            class = "rounded" alt = "Rounded Image" width = "200" height = "two hundred"> 
         
         <p></p>
         <h2>Circle Image</h2>
         <img src = "https://www.Welookups.Com/bootstrap/images/sixty four.Jpg" 
            class = "rounded-circle" alt = "Rounded Image" width = "2 hundred" peak = "2 hundred">
         
         <p></p>
         <h2>Thumbnail Image</h2>
         <img src = "https://www.Welookups.Com/bootstrap/pics/sixty four.Jpg"
            magnificence = "img-thumbnail" alt = "Rounded Image" width = "two hundred" peak = "200">
      </div>
      
      <!-- jQuery first, then Popper.Js, then Bootstrap JS -->
      <script src = "https://code.Jquery.Com/jquery-three.Three.1.Slender.Min.Js" 
         integrity = "sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" 
         crossorigin = "anonymous">
      </script>
      
      <script src = "https://cdnjs.Cloudflare.Com/ajax/libs/popper.Js/1.14.3/umd/popper.Min.Js" 
         integrity = "sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" 
         crossorigin = "nameless">
      </script>
      
      <script src = "https://stackpath.Bootstrapcdn.Com/bootstrap/four.1.Three/js/bootstrap.Min.Js" 
         integrity = "sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" 
         crossorigin = "anonymous">
      </script>
      
   </frame>
</html>
It will produce the following end result −

Aligning Images

You can use either Bootstrap's helper glide lessons or text alignment instructions to align pics horizontally.

Float

Use Bootstrap's .Go with the flow-left, .Waft-proper, .Glide-*-left, and .Float-*-right lessons to flow an image to the left or proper.

The following instance demonstrates alignment of photographs −

<html lang = "en">
   <head>
      <!-- Meta tags -->
      <meta charset = "utf-8">
      <meta name = "viewport" content material = "width = tool-width, initial-scale = 1, cut back-to-match = no">
      
      <!-- Bootstrap CSS -->
      <link rel = "stylesheet" 
         href = "https://stackpath.Bootstrapcdn.Com/bootstrap/four.1.3/css/bootstrap.Min.Css" 
         integrity = "sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" 
         crossorigin = "anonymous">
      
      <title>Bootstrap four Example</title>
   </head>
   
   <frame>
      <div class = "container">
         <h2>Aligning Images</h2>
         <br>
         <img src = "https://www.Welookups.Com/bootstrap/pictures/64.Jpg" 
            elegance = "go with the flow-left" alt = "Left Image" width = "200" top = "2 hundred"> 
         
         <img src = "https://www.Welookups.Com/bootstrap/pics/64.Jpg" 
            elegance = "flow-proper" alt = "Right Image" width = "200" height = "2 hundred">
            
         <p></p>
      </div>
      
      <!-- jQuery first, then Popper.Js, then Bootstrap JS -->
      <script src = "https://code.Jquery.Com/jquery-3.Three.1.Slim.Min.Js" 
         integrity = "sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" 
         crossorigin = "anonymous">
      </script>
      
      <script src = "https://cdnjs.Cloudflare.Com/ajax/libs/popper.Js/1.14.Three/umd/popper.Min.Js" 
         integrity = "sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" 
         crossorigin = "nameless">
      </script>
      
      <script src = "https://stackpath.Bootstrapcdn.Com/bootstrap/4.1.Three/js/bootstrap.Min.Js" 
         integrity = "sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" 
         crossorigin = "anonymous">
      </script>
      
   </body>
</html>

Responsive Images

You can make the responsive images (routinely alter to in shape the size of the screen across devices) via using the .Img-fluid magnificence (gives max-width: one hundred%; and peak: auto; to the photo).

The following instance demonstrates displaying of responsive within the record −

<html lang = "en">
   <head>
      <!-- Meta tags -->
      <meta charset = "utf-8">
      <meta call = "viewport" content material = "width = device-width, initial-scale = 1, cut back-to-fit = no">
      
      <!-- Bootstrap CSS -->
      <hyperlink rel = "stylesheet" 
         href = "https://stackpath.Bootstrapcdn.Com/bootstrap/four.1.Three/css/bootstrap.Min.Css" 
         integrity = "sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" 
         crossorigin = "nameless">
      
      <name>Bootstrap 4 Example</name>
   </head>
   <frame>
      <div class="box">
         <h2>Responsive Image</h2>
         <img src = "https://www.Welookups.Com/bootstrap/snap shots/64.Jpg" 
            elegance = "img-fluid" alt = "Responsive Image" width = "two hundred" top = "200">
      </div>
      
      <!-- jQuery first, then Popper.Js, then Bootstrap JS -->
      <script src = "https://code.Jquery.Com/jquery-three.Three.1.Slim.Min.Js" 
         integrity = "sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" 
         crossorigin = "anonymous">
      </script>
      
      <script src = "https://cdnjs.Cloudflare.Com/ajax/libs/popper.Js/1.14.3/umd/popper.Min.Js" 
         integrity = "sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" 
         crossorigin = "nameless">
      </script>
      
      <script src = "https://stackpath.Bootstrapcdn.Com/bootstrap/4.1.3/js/bootstrap.Min.Js" 
         integrity = "sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" 
         crossorigin = "anonymous">
      </script>
      
   </body>
</html>