What is the image class in bootstrap?

Bootstrap has an img class that allows users to set various properties for images and display them responsively. The class enables images to be scaled according to the screen size while making sure the images do not exceed the size of the parent class.

The image class has various available properties, some of which are demonstrated below:

Responsive images

Adding the .img-responsive class to the image enables images to be responsive and allows them to scale with the parent element.

Image thumbnails

We can also add thumbnails to our image using the .img-thumbnail. This thumbnail will give the image a rounded 1px border appearance:

Image thumbnails

The .img-circle class encloses the image inside a circle:

New on Educative
Learn to Code
Learn any Language as a beginner
Develop a human edge in an AI powered world and learn to code with AI from our beginner friendly catalog
🏆 Leaderboard
Daily Coding Challenge
Solve a new coding challenge every day and climb the leaderboard

Free Resources