I am using a bootstrap design here.
I am trying to do the below. This is where I set the div tag height surrounding the image to be the same as the width manually. This makes it such that the white space above and below the image is the same.
However, if the browser resizes, the image width and height will change accordingly. I cannot set a fixed height as the image will remain at its size and will not resize accordingly. But however if I do not set it, the image will float to the top, and the height of the overall box will be different from the rest of the boxes.
Setting padding-bottom and top to 50% to set ratio to 1:1, however this does not work. (This makes the box bigger than it should, and screws up the ratios)
<div class="product">
<div class="product-img">
<img src="http://127.0.0.1:8080/SpGames/admin/gameimage.jsp?game_id=1" alt="" style="">
</div>
<div class="product-body">
<p class="product-category">Category</p>
<h3 class="product-name"><a href="#">product name goes here</a></h3>
<h4 class="product-price">$980.00 <del class="product-old-price">$990.00</del></h4>
<div class="product-rating">
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
</div>
<div class="product-btns">
<button class="add-to-wishlist"><i class="fa fa-heart-o"></i><span class="tooltipp">add to wishlist</span></button>
<button class="add-to-compare"><i class="fa fa-exchange"></i><span class="tooltipp">add to compare</span></button>
<button class="quick-view"><i class="fa fa-eye"></i><span class="tooltipp">quick view</span></button>
</div>
</div>
<div class="add-to-cart">
<button class="add-to-cart-btn"><i class="fa fa-shopping-cart"></i> add to cart</button>
</div>
</div>
The height of the entire box should be the same as the rest, and the image to be vertically aligned in the middle with the rest.