We would like to know how to center image to for web page.
<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
img {<!--from w ww .j a va2 s.c o m-->
position: absolute;
margin: auto;
top: 0;
bottom: 0;
left: 0;
right: 0;
max-width: 100%;
max-height: 100%;
}
</style>
</head>
<body>
<img src="http://www.java2s.com/style/download.png"/>
</body>
</html>
The code above is rendered as follows: