Overlay image inside <div> - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Image

Description

Overlay image inside <div>

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">
.content {<!--from ww  w . j a  v  a2  s.co  m-->
   width:501px;
   height:501px;
   border:16px solid Chartreuse;
   margin-top:0;
   padding-top:0;
   vertical-align:top
}

img#post-backgrnd {
   top:-16px;
   left:-16px;
   position:relative;
}
</style> 
 </head> 
 <body> 
  <div class="content"> 
   <img src="https://www.java2s.com/style/demo/Firefox.png" id="post-backgrnd">Lorem ipsum dolo 
  </div>  
 </body>
</html>

Related Tutorials