We would like to know how to align an image to center.
<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
img.displayed {<!-- ww w . jav a 2s . c o m-->
display: block;
margin-left: auto;
margin-right: auto;
}
</style>
</head>
<body>
<img src="http://www.java2s.com/style/download.png" class="displayed"/>
</body>
</html>
The code above is rendered as follows: