bootstrap method to make images adaptive:
1. If you are inserting an image on the page, just add class="img-responsive"
2. If it is in the content page, just use js to add attributes to each img. .
$(".setting img").addClass("img-responsive center-block"); //center-block The picture is horizontally centered
In Bootstrap version 3, pass as the picture Adding the .img-responsive class allows images to support responsive layout. The essence is to set the max-width: 100%;, height: auto; and display: block; attributes for the image, so that the image can be better scaled in its parent element.
For more technical articles related to Bootstrap, please visit the Bootstrap Tutorial column to learn!
The above is the detailed content of How to make images adaptive with bootstrap. For more information, please follow other related articles on the PHP Chinese website!