In Bootstrap 4 add .img-fluid
class to make the image responsive. This will
make it to be always 100% width of the parent element.
Example:
<img src="https://example-image.com" class="img-fluid">
The gray border of each picture shows the size of his parent element.
Detailed documentation and more examples about Bootstrap image slider you can find in our Bootstrap Images Docs
Basic example - the image below will always have 100% width of the parent element.
Since Bootstrap is developed to be mobile first, we use a handful of media queries to create sensible breakpoints for our layouts and interfaces. These breakpoints are mostly based on minimum viewport widths and allow us to scale up elements as the viewport changes.
Detailed documentation and more examples you can find in our Bootstrap Media Queries Docs.
Media queries
// Extra small devices (portrait phones, less than 576px)
// No media query since this is the default in Bootstrap
// Small devices (landscape phones, 576px and up)
@media (min-width: 576px) { ... }
// Medium devices (tablets, 768px and up)
@media (min-width: 768px) { ... }
// Large devices (desktops, 992px and up)
@media (min-width: 992px) { ... }
// Extra large devices (large desktops, 1200px and up)
@media (min-width: 1200px) { ... }