Align overlaid text on the right - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Text

Description

Align overlaid text on the right

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">
body {<!--from  w ww  .j  a va2 s  . co m-->
   margin:auto;
   width:601px;
}

.wrap {
   position:relative;
}

img {
   margin:auto;
   display:block;
   border:2px solid Chartreuse;
}

p {
   position:absolute;
   top:11%;
   right:0px;
}
</style> 
 </head> 
 <body> 
  <div class="wrap"> 
   <p>Overlaid text</p> 
   <img border="1" width="600px" height="100px" src="https://www.java2s.com/style/demo/Google-Chrome.png"> 
  </div> 
  <img border="1" width="200px" height="200px" src="https://www.java2s.com/style/demo/Google-Chrome.png"> 
  <br> 
  <img border="1" width="600px" height="100px" src="https://www.java2s.com/style/demo/Opera.png"> 
  <br>  
 </body>
</html>

Related Tutorials