Working in old browsers (IE >= 8)
Automatic margins, paired with values of zero for the left and right or top and bottom offsets, will center an absolutely positioned elements within its parent.
HTML
<div class="parent">
<img class="center" src="/?originalUrl=https%3A%2F%2Friptutorial.com%2F%26quot%3Bhttp%3A%2F%2Florempixel.com%2F400%2F200%2F%26quot%3B%2520%2F%26gt%3B%26lt%3B%2Fdiv%26gt%3B%253C%2Fcode">
CSS
.parent {
position: relative;
height: 500px;
}
.center {
position: absolute;
margin: auto;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
Elements that don't have their own implicit width and height like images do, will need those values defined.
Other resources: Absolute Centering in CSS