position text over an image with html - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Image Text Position

Description

position text over an image with html

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">
#mainContainer img
 {
   position:absolute;
}

#mainContainer p<!--  w  ww  .j a v a2  s .  c o m-->
 {
   position:absolute;
}
</style> 
 </head> 
 <body> 
  <div id="mainContainer"> 
   <img src="https://www.java2s.com/style/demo/Firefox.png"> 
   <p>Lorem ipsum</p> 
  </div>  
 </body>
</html>

Related Tutorials