We would like to know how to centre an image inside a div.
<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
#footer img.display {<!--from w w w.j ava2 s . c o m-->
display: block;
margin-left: auto;
margin-right: auto;
text-align: center;
height: 50px;
width: 300px;
}
</style>
</head>
<body>
<div id="footer">
<img src="http://www.java2s.com/style/download.png" class="display" />
</div>
</body>
</html>
The code above is rendered as follows: