Home  >  Article  >  Web Front-end  >  How to set image shape in bootstrap4

How to set image shape in bootstrap4

爱喝马黛茶的安东尼
爱喝马黛茶的安东尼Original
2019-07-17 16:26:252507browse

How to set image shape in bootstrap4

Rounded corner picture

.rounded class allows the picture to display the rounded corner effect:

Example

<img src="cinqueterre.jpg" class="rounded" alt="Cinque Terre">

How to set image shape in bootstrap4

Ellipse picture

.rounded-circle class can set an elliptical picture :

Example

<img src="cinqueterre.jpg" class="rounded-circle" alt="Cinque Terre">

How to set image shape in bootstrap4

Related recommendations: "bootstrap Getting Started Tutorial"

Thumbnail

.img-thumbnail class is used to set picture thumbnails (pictures have borders):

Instance

<img src="cinqueterre.jpg" class="img-thumbnail" alt="Cinque Terre">

How to set image shape in bootstrap4

Picture alignment

Use the .float-right class to set the right alignment of the picture, and use the .float-left class to set the left alignment of the picture:

Example

<img  src="paris.jpg" class="float-left" alt="How to set image shape in bootstrap4" > <img  src="cinqueterre.jpg" class="float-right" alt="How to set image shape in bootstrap4" >

How to set image shape in bootstrap4

Responsive images

Images come in a variety of sizes , we need to automatically adapt according to the size of the screen.

We can set up responsive images by adding the .img-fluid class in the How to set image shape in bootstrap4 tag.

.img-fluid 类设置了 max-width: 100%; 、 height: auto; :

Example

<img class="img-fluid" src="img_chania.jpg" alt="Chania">

How to set image shape in bootstrap4

The above is the detailed content of How to set image shape in bootstrap4. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn