Horje
What is use of the img-fluid Class in Bootstrap ?

The img-fluid class in Bootstrap is designed for responsive images, ensuring they scale appropriately within their parent containers without overflowing or distorting.

Note: Always include the alt attribute for accessibility and SEO purposes. By applying this class to images, developers ensure that the images seamlessly adjust to the dimensions of their containing elements, preventing undesired overflow or distortion.

Syntax:

<img src="your-image.jpg" class="img-fluid" alt="Responsive Image">

Purpose:

  • Makes images responsive, automatically adjusting their width to fit their container across different screen sizes.
  • Prevents images from exceeding their container width, ensuring a clean and visually harmonious layout.

Key Features:

  • Fluid width: Applies max-width: 100%; and height: auto; to images, enabling responsiveness.
  • Maintains aspect ratio: Preserves the original image proportions to avoid distortion.
  • Cross-browser compatibility: Works consistently across major browsers.




Reffered: https://www.geeksforgeeks.org


Bootstrap

Related
How to create a Button in Bootstrap 5? How to create a Button in Bootstrap 5?
What is use of the navbar Class in Bootstrap ? What is use of the navbar Class in Bootstrap ?
What are the different Navbar Components in Bootstrap? What are the different Navbar Components in Bootstrap?
What are Different Types of Carousel Indicators in Bootstrap ? What are Different Types of Carousel Indicators in Bootstrap ?
What is use of the carousel-item Class in Bootstrap? What is use of the carousel-item Class in Bootstrap?

Type:
Geek
Category:
Coding
Sub Category:
Tutorial
Uploaded by:
Admin
Views:
11