Have you tried margin: 0 auto; text-align: center;
? This is the best way to center horizontally.
For this you should wrap a div something like this:
<div class="hCenter">
<div class="productImg"></div>
</div>
Then css would be as following:
.hCenter{
position: relative;
margin: 0 auto;
text-align: center;
}
productImg{
/*now you can align position absolute*/
/*other code in here*/
}
Edit
If you still want to be aligned horizontally centered with absolute position, you could do like this demo
.productImg {
width: 50%;
position: absolute;
right: 25%; /* half of the width percentage*/
background-color: red;
height: 200px;
}
Edit 1
If your parent div is positioned absolutely, then you don't need to set position: absolute
your .productImg
. Just add margin: 0 auto; text-align: center;