Source

εικόνες

Τεκμηρίωση και παραδείγματα για την επιλογή των εικόνων σε συμπεριφορά απόκρισης (ώστε να μην γίνονται ποτέ μεγαλύτερα από τα μητρικά τους στοιχεία) και να προσθέσετε ελαφριά στυλ σε αυτά — όλα μέσω κλάσεων.

Αποκριτικές εικόνες

Οι εικόνες στο Bootstrap αποκρίνονται με .img-fluid. max-width: 100%;και height: auto;εφαρμόζονται στην εικόνα έτσι ώστε να κλιμακώνεται με το γονικό στοιχείο.

Placeholder Responsive image
<img src="..." class="img-fluid" alt="Responsive image">
Εικόνες SVG και IE 10

In Internet Explorer 10, SVG images with .img-fluid are disproportionately sized. To fix this, add width: 100% \9; where necessary. This fix improperly sizes other image formats, so Bootstrap doesn’t apply it automatically.

Image thumbnails

In addition to our border-radius utilities, you can use .img-thumbnail to give an image a rounded 1px border appearance.

A generic square placeholder image with a white border around it, making it resemble a photograph taken with an old instant camera 200x200
<img src="..." alt="..." class="img-thumbnail">

Aligning images

Align images with the helper float classes or text alignment classes. block-level images can be centered using the .mx-auto margin utility class.

Placeholder 200x200 Placeholder 200x200
<img src="..." class="rounded float-left" alt="...">
<img src="..." class="rounded float-right" alt="...">
Placeholder 200x200
<img src="..." class="rounded mx-auto d-block" alt="...">
Placeholder 200x200
<div class="text-center">
  <img src="..." class="rounded" alt="...">
</div>

Picture

Εάν χρησιμοποιείτε το <picture>στοιχείο για να καθορίσετε πολλά <source>στοιχεία για ένα συγκεκριμένο <img>, φροντίστε να προσθέσετε τις .img-*κλάσεις στο <img>και όχι στην <picture>ετικέτα.

<picture>
  <source srcset="..." type="image/svg+xml">
  <img src="..." class="img-fluid img-thumbnail" alt="...">
</picture>