We would like to know how to center image with max width.
<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.img {<!-- w w w . j a v a 2 s.com-->
display: block;
margin: 0 auto;
max-width: 900px;
top: 10px;
width: 60%;
height: 70%;
}
</style>
</head>
<body>
<img class="img" src="http://www.java2s.com/style/download.png" alt="" />
</body>
</html>
The code above is rendered as follows: