css center image

CSS
.center {
  display: block;
  margin-left: auto;
  margin-right: auto;
}.centerImg {
  display: block;
  margin: 0 auto;
}<div style="text-align: center;">
  <img scr='img/example.jpg'>
</div>  <img src="paris.jpg" alt="Paris" class="center"> sdhsdgdfgs  <style>
.content {
  max-width: 500px;
  
  margin: auto;
}
</style>

  <body>

<div class="content">
  <!-- Page content -->
</div>

</body> 
Source

Also in CSS: