Bootstrap Images
Bootstrap makes it easy to add images to your website and make them responsive.
Syntax
To add an image to your HTML file using Bootstrap, use the following code:
<img src="image.jpg" class="img-fluid" alt="Responsive image">
Bootstrap makes it easy to add images to your website and make them responsive.
To add an image to your HTML file using Bootstrap, use the following code:
<img src="image.jpg" class="img-fluid" alt="Responsive image">
Here is an example of how to add an image using Bootstrap
<img src="https://static.additionalsheet.com/images//others/lucy.jpg" class="img-fluid" alt="Responsive image">
<img src="https://static.additionalsheet.com/images//others/lucy.jpg" class="img-fluid rounded" alt="Rounded image">
<img src="https://static.additionalsheet.com/images//others/lucy.jpg" class="img-fluid rounded-circle" alt="Circular image">
<img src="https://static.additionalsheet.com/images//others/lucy.jpg" class="img-fluid square" alt="Square image">
<img src="https://static.additionalsheet.com/images//others/lucy.jpg" class="img-thumbnail" alt="Thumbnail image">
In the code above, we used the img-fluid
class to make the image responsive. This class tells Bootstrap to make the image fluid and adjust to the width of the screen. The alt
attribute is used to provide alternative text for the image.
Bootstrap's image classes can be used to create a variety of image formats, such as rounded images, circle images, and square images. These classes can be applied to the img
element as follows:
.rounded
: adds rounded corners to the image.rounded-circle
: creates a circular image.square
: makes the image squareimg-fluid
).alt
attribute should always be used for images to provide alternative text for screen readers and improve accessibility.Bootstrap's image classes make it easy to create a variety of image formats and ensure they are responsive and accessible. It is important to always use the alt
attribute to provide alternative text for the image and improve accessibility.