How to set image shape in bootstrap4

爱喝马黛茶的安东尼
Release: 2019-07-17 16:30:33
Original
2489 people have browsed it

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">
Copy after login

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">
Copy after login

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">
Copy after login

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" >
Copy after login

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; :
Copy after login

Example

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

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!

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!