How to set the responsive image on container in bootstrap 5?

How to set the responsive image on container in default size of image in bootstrap 5?

Last updated:1/4/2022 6:35:29 AM

1 Answers

Manish Manish
Manish Manish

Responsive Image on container in bootstrap 5

    You can set the default size of image on <div> container in your design page of your website page by using the following bootstrap code,

<div class='container-fluid'>

<img src='C:\Users\msclient008\Desktop\Link\pic.png' class='img-fluid' alt='feature-img'>
</div> 

How to set the responsive image on container in bootstrap 5?

the above image is set its default size on container and if you want to set the specific size of the image then bootstrap 5 provide class the set the size of image like as,

<div class='container-fluid'>

<img src='C:\Users\msclient008\Desktop\Link\pic.png' class='img-fluid h-100 w-100' alt='feature-img'>
</div> 

h-100 is use to set the 100% height of image and w-100 is used for 100% width of image

Answer