Home Web Front-end Bootstrap Tutorial How to set image shape in bootstrap4

How to set image shape in bootstrap4

Jul 17, 2019 pm 04:26 PM

How to set image shape in bootstrap4

Rounded corner picture

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

Example

<img class="rounded lazy"  src="/static/imghw/default1.png"  data-src="cinqueterre.jpg"    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 class="rounded-circle lazy"  src="/static/imghw/default1.png"  data-src="cinqueterre.jpg"    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 class="img-thumbnail lazy"  src="/static/imghw/default1.png"  data-src="cinqueterre.jpg"    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  class="float-left lazy"  src="/static/imghw/default1.png"  data-src="paris.jpg"    alt="How to set image shape in bootstrap4" > <img  class="float-right lazy"  src="/static/imghw/default1.png"  data-src="cinqueterre.jpg"    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 lazy"  src="/static/imghw/default1.png"  data-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!

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

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How do I stay up-to-date with the latest Bootstrap releases and updates? How do I stay up-to-date with the latest Bootstrap releases and updates? Mar 14, 2025 pm 07:40 PM

How do I stay up-to-date with the latest Bootstrap releases and updates?

How do I override Bootstrap's styles without modifying the core framework files? How do I override Bootstrap's styles without modifying the core framework files? Mar 14, 2025 pm 07:44 PM

How do I override Bootstrap's styles without modifying the core framework files?

What are the key components of the Bootstrap framework (grid system, typography, components, utilities)? What are the key components of the Bootstrap framework (grid system, typography, components, utilities)? Mar 14, 2025 pm 07:42 PM

What are the key components of the Bootstrap framework (grid system, typography, components, utilities)?

Where can I find Bootstrap templates and themes? Where can I find Bootstrap templates and themes? Mar 14, 2025 pm 07:39 PM

Where can I find Bootstrap templates and themes?

How do I use Bootstrap's grid system to create responsive layouts for different screen sizes? How do I use Bootstrap's grid system to create responsive layouts for different screen sizes? Mar 14, 2025 pm 07:43 PM

How do I use Bootstrap's grid system to create responsive layouts for different screen sizes?

How do I customize the appearance and behavior of Bootstrap's components? How do I customize the appearance and behavior of Bootstrap's components? Mar 18, 2025 pm 01:06 PM

How do I customize the appearance and behavior of Bootstrap's components?

Can I use inline-block in the Bootstrap picture centered? Can I use inline-block in the Bootstrap picture centered? Mar 04, 2025 pm 03:06 PM

Can I use inline-block in the Bootstrap picture centered?

How do I make Bootstrap websites accessible (A11y)? How do I make Bootstrap websites accessible (A11y)? Mar 14, 2025 pm 07:36 PM

How do I make Bootstrap websites accessible (A11y)?

See all articles