HTML Element Style How to - Centre an image inside a div


We would like to know how to centre an image inside a div.


<!DOCTYPE html>
<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;
  <div id="footer">
    <img src="" class="display" />

The code above is rendered as follows: