Bootstrap Image Classes: Styling and Usage Guide
Table of Content:
Only Important Code
Rounded Corners
The .rounded class adds rounded corners to an image:
Full Code For The Above Example
See Live Preview of the above codeBootstrap Example Rounded Corners
The .rounded class adds rounded corners to an image:
Only Important Code
Circle
The .rounded-circle class shapes the image to a circle:
Full Code For The Above Example
See Live Preview of the above codeBootstrap Example Circle
The .rounded-circle class shapes the image to a circle:
Only Important Code
Thumbnail
The .img-thumbnail class creates a thumbnail of the image:
Full Code For The Above Example
See Live Preview of the above codeBootstrap Example Thumbnail
The .img-thumbnail class creates a thumbnail of the image:
Only Important Code
Aligning images
Use the float classes to float the image to the left or to the right:
Full Code For The Above Example
See Live Preview of the above codeBootstrap Example Aligning images
Use the float classes to float the image to the left or to the right:
Only Important Code
Centered Image
Center an image by adding the utility classes .mx-auto (margin:auto) and .d-block (display:block) to the image:
Full Code For The Above Example
See Live Preview of the above codeBootstrap Example Centered Image
Center an image by adding the utility classes .mx-auto (margin:auto) and .d-block (display:block) to the image:
Only Important Code
Image
The .img-fluid class makes the image scale nicely to the parent element (resize the browser window to see the effect):
Full Code For The Above Example
See Live Preview of the above codeBootstrap Example Image
The .img-fluid class makes the image scale nicely to the parent element (resize the browser window to see the effect):