I am currently working on a webpage that has a responsive design.
The page features a list of products, with the product listing adjusting in size as the page width changes.
My goal is to center the product image within its container, ensuring that the image fits the width and size of the container while always remaining centered within the .product
<div class='product'>
<div class="image_wrapper">
<a href="/products/1">
<img scr="http://awesome.image.com/1.jpg">
</a>
</div>
</div>
Due to the responsiveness of the page, the dimensions of the content can vary.
I would appreciate any advice on how to achieve this.
Update
To further illustrate the issue, I have created a fiddle: When the screen size shrinks, the image should remain centered, with the tower maintaining its position at the center. The black shading on the sides should disappear if the image exceeds the container's width.