Create a div with text inside image - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Image Text

Description

Create a div with text inside image

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">
#container<!--from   w  ww .j  av  a 2 s .  co  m-->
 {
   height:auto;
   width:auto;
}

#content
 {
   position:absolute;
   height:auto;
   width:auto;
   top:151px;
   left:100px;
}

#content h1
 {
   color:Chartreuse;
   font-weight:bold;
   font-size:23px;
}

#content p
 {
   color:yellow;
}
</style> 
 </head> 
 <body> 
  <div id="container"> 
   <img src="https://www.java2s.com/style/demo/InternetExplorer.png"> 
   <div id="content"> 
    <h1>Lorem ipsum dolor sit </h1> 
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamc</p> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials