HTML CSS examples for CSS Widget:Image Text
Make text appear below the center image
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> html, body { height:100%; margin:0; padding:0; background-color:Chartreuse; } div {<!-- w w w. j av a 2s . c o m--> position:relative; height:100%; width:100%; } div img { position:absolute; top:0; left:0; right:0; bottom:0; margin:auto; } p { text-align:center; margin-top:-51px; } </style> </head> <body> <div> <img src="https://www.java2s.com/style/demo/Opera.png"> <p>Lorem ipsum</p> </div> </body> </html>