HTML CSS examples for CSS Widget:Image Text
Placing box and text over image z-index
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .wrap {<!--from ww w . j a v a 2 s . c o m--> position:relative; width:201px; height:146px; border:2px solid Chartreuse; } .backbox { z-index:100; position:absolute; min-height:31px; left:0; right:0; bottom:0; background:yellow; } .text { z-index:1000; color:blue; font-size:21px; font-weight:bold; } </style> </head> <body> <div class="wrap"> <img src="https://www.java2s.com/style/demo/Opera.png"> <div class="backbox"> <div class="text"> Lorem i </div> </div> </div> </body> </html>