This article covers 3 sections namely
- Responsive Images
- Images Shapes can be changed with built in classes
- Alignment of images
img-fluid class needs to be added in bootstrap version 4 and img-responsive in bootstrap version 3.This make the images to align with the parent element of a webpage by setting the
max-width:100% and height:auto repectively. Additionally display:block is applied in bootstrap version 3.Image Shapes can be changed with built in classes
Bootstrap support 3 different shapes for an images namely rounded, circle and thumbnail
Built in classes
.img-rounded, .img-circle and .img-thumbnail can be used to change the shape of an image with rounded corners, circular and to thumbnail view as shown below.Alignment of images
Image will get aligned to left with
.pull-xs-left class and to right with .pull-xs-right class.Centering of image can be done with
.center-block class.