gpt-4o-mini-2024-07-18· OpenAI
WildChat-4.8M (AI2)
I have a two columns of col-md-6 each, on one of col-md-6 is the image, how can I make…
- User
I have a two columns of col-md-6 each, on one of col-md-6 is the image, how can I make that image mobile responsive, bootstrap 5.3.3 code.
- Assistant
To make an image mobile-responsive using Bootstrap 5.3.3, you can use the
.img-fluidclass, which makes the image scale with the parent element. Here’s how you can structure your HTML with two columns, where one column contains the image:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Bootstrap Responsive Image</title> <link href="https://stackpath.bootstrapcdn.com/bootstrap/5.3.3/css/bootstrap.min.css" rel="stylesheet"> </head> <body> <div class="container"> <div class="row"> <div class="col-md-6"> <!-- Image Column --> <img src="path/to/your/image.jpg" class="img-fluid" alt="Responsive image"> </div> <div class="col-md-6"> <!-- Other Content Column --> <h2>Content Title</h2> <p>This is where you can put your content. The image on the left will be responsive.</p> </div> </div> </div> <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.0.11/dist/umd/popper.min.js"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/5.3.3/js/bootstrap.min.js"></script> </body> </html>