Align image in center with margin auto - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Image Align

Description

Align image in center with margin auto

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
#foto {<!--from   w  ww .jav a2 s.  c  o m-->
   width:100%;
}

#foto img {
   display:block;
   margin:0 auto;
}
</style> 
 </head> 
 <body> 
  <div id="foto"> 
   <img src="https://www.java2s.com/style/demo/Firefox.png" width="160" height="240" alt="foto1"> 
  </div>  
 </body>
</html>

Related Tutorials