Centre an img within a div
HTML
<html>
<body>
<div>
<img src="http://www.waleoyediran.com/wp-content/uploads/2011/04/stackoverflow.png"/>
</div>
</body>
</html>
CSS
div, img {
border: 1px solid black;
}
div {
width: 200px;
height: 200px;
text-align: center;
line-height: 200px;
}
img {
max-width: 190px;
max-height: 190px;
vertical-align: middle;
}