HTML CSS examples for CSS Widget:Image Text
Transparent layer of text over an image
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .image-container {<!-- w w w . ja va2 s . c om--> position:relative; } .caption { width:100%; background:Chartreuse; color:yellow; position:absolute; top:0; } </style> </head> <body> <div class="image-container"> <img src="https://www.java2s.com/style/demo/Opera.png"> <p class="caption">Lorem i</p> </div> </body> </html>