We would like to know how to center align an image consistently.
<!DOCTYPE html>
<html>
<head>
<style>
.header {<!--from w ww . j av a2 s . com-->
width: 200px;
margin: 0 auto;
}
</style>
</head>
<body>
<div class="header">
<img src="http://www.placehold.it/200x100" alt="logo" />
</div>
</body>
</html>
The code above is rendered as follows: