Centering over sized image in responsive div - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Image

Description

Centering over sized image in responsive div

Demo Code

ResultView the demo in separate window

<html lang="en">
 <head> 
  <style>
.oversizedImage {<!--  w ww.  j a  v a  2 s .  c  o m-->
   text-align:center;
}

.oversizedImage img {
   margin:0 -100%;
}

.oversizedImage {
   width:51%;
   margin:auto;
   border:solid;
   box-shadow:0 0 51px 51px white
}

.oversizedImage img {
   vertical-align:top;
   position:relative;
   z-index:-2;
}
</style> 
 </head> 
 <body translate="no"> 
  <div class="oversizedImage"> 
   <img src="https://www.java2s.com/style/demo/InternetExplorer.png"> 
  </div>  
 </body>
</html>

Related Tutorials