- Изображения
- Адаптивные изображения
- Эскизы изображений
- Выравнивание изображений
- Картина
- Sass
- Переменные
- Images
- Responsive images
- Aligning images
- Picture
- Images
- Responsive images
- Image thumbnails
- Aligning images
- Picture
- Sass
- Variables
- Изображения
- Отзывчивые изображения
- Выравнивание изображений
- Картинка
- Images
- Responsive images
- Aligning images
- Picture
Изображения
Документация и примеры для настройки изображений на адаптивное поведение (чтобы они никогда не становились больше, чем их родительские элементы) и добавления к ним легких стилей — все через классы.
Адаптивные изображения
Изображения в Bootstrap сделаны адаптивными с помощью .img-fluid . Это применяет max-width: 100%; и height: auto; к изображению так, чтобы оно масштабировалось вместе с родительским элементом.
img src=". " class="img-fluid" alt=". ">
Эскизы изображений
В дополнение к нашим утилитам border-radius Вы можете использовать .img-thumbnail , чтобы придать изображению округлую границу в 1 пиксель.
Обычное квадратное изображение-заполнитель с белой рамкой вокруг него, что делает его похожим на фотографию, сделанную на старую камеру мгновенного действия.
img src=". " class="img-thumbnail" alt=". ">
Выравнивание изображений
Выровняйте изображения по вспомогательным классам с плавающей точкой или классам выравнивания текста. Изображения уровня block можно центрировать с помощью утилиты класса поля .mx-auto .
img src=". " class="rounded float-start" alt=". "> img src=". " class="rounded float-end" alt=". ">
img src=". " class="rounded mx-auto d-block" alt=". ">
div class="text-center"> img src=". " class="rounded" alt=". "> div>
Картина
Если Вы используете элемент для указания нескольких элементов для определенного , убедитесь, что Вы добавили классы .img-* в
, а не в тег .
picture> source srcset=". " type="image/svg+xml"> img src=". " class="img-fluid img-thumbnail" alt=". "> picture>
Sass
Переменные
Переменные доступны для миниатюр изображений.
$thumbnail-padding: .25rem; $thumbnail-bg: $body-bg; $thumbnail-border-width: $border-width; $thumbnail-border-color: $gray-300; $thumbnail-border-radius: $border-radius; $thumbnail-box-shadow: $box-shadow-sm;
- Разработан и построен с любовью в мире командой Bootstrap с помощью наших участников.
- Код под лицензией MIT, документация CC BY 3.0.
- Текущая версия v5.0.2.
Images
Documentation and examples for opting images into responsive behavior (so they never become larger than their parent elements) and add lightweight styles to them—all via classes.
Responsive images
Images in Bootstrap are made responsive with .img-fluid . max-width: 100%; and height: auto; are applied to the image so that it scales with the parent element.
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.
class="text-center"> src=". " class="rounded" alt=". ">
Picture
If you are using the element to specify multiple elements for a specific , make sure to add the .img-* classes to the
and not to the tag.
srcset=". " type="image/svg+xml"> src=". " class="img-fluid img-thumbnail" alt=". ">
Images
Documentation and examples for opting images into responsive behavior (so they never become larger than their parent elements) and add lightweight styles to them—all via classes.
Responsive images
Images in Bootstrap are made responsive with .img-fluid . This applies max-width: 100%; and height: auto; to the image so that it scales with the parent element.
img src=". " class="img-fluid" alt=". ">
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
img src=". " class="img-thumbnail" alt=". ">
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.
img src=". " class="rounded float-start" alt=". "> img src=". " class="rounded float-end" alt=". ">
img src=". " class="rounded mx-auto d-block" alt=". ">
div class="text-center"> img src=". " class="rounded" alt=". "> div>
Picture
If you are using the element to specify multiple elements for a specific , make sure to add the .img-* classes to the
and not to the tag.
picture> source srcset=". " type="image/svg+xml"> img src=". " class="img-fluid img-thumbnail" alt=". "> picture>
Sass
Variables
Variables are available for image thumbnails.
$thumbnail-padding: .25rem; $thumbnail-bg: $body-bg; $thumbnail-border-width: $border-width; $thumbnail-border-color: $gray-300; $thumbnail-border-radius: $border-radius; $thumbnail-box-shadow: $box-shadow-sm;
- Designed and built with all the love in the world by the Bootstrap team with the help of our contributors.
- Code licensed MIT, docs CC BY 3.0.
- Currently v5.0.2.
- Analytics by Fathom.
Изображения
Документация и примеры приведения изображений к отзывчивому поведению (так, чтобы их размер не выходил за рамки родительского элемента) и добавления к ним «легковесных» стилей – всё посредством классов.
Отзывчивые изображения
Изображения в Bootstrap делаются «отзывчивыми» с помощью .img-fluid . max-width: 100%; и height: auto; применяемых к изображению, которое т.о. масштабируется по родительскому элементу.
Выравнивание изображений
Выравнивайте изображения вспомогательными классами выравнивания по стороне или классами выравнивания текста. Блочные изображения block можно центрировать использованием класса утилиты «марджина» the .mx-auto .
class="text-center"> src=". " class="rounded" alt=". ">
Картинка
Если вы используете элемент для привязки множественных элементов к определенному , добавьте классы .img-* в
, а не в .
srcset=". " type="image/svg+xml"> src=". " class="img-fluid img-thumbnail" alt=". ">
Images
Documentation and examples for opting images into responsive behavior (so they never become larger than their parent elements) and add lightweight styles to them—all via classes.
Responsive images
Images in Bootstrap are made responsive with .img-fluid . max-width: 100%; and height: auto; are applied to the image so that it scales with the parent element.
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.
class="text-center"> src=". " class="rounded" alt=". ">
Picture
If you are using the element to specify multiple elements for a specific , make sure to add the .img-* classes to the
and not to the tag.
srcset=". " type="image/svg+xml"> src=". " class="img-fluid img-thumbnail" alt=". ">