HTML CSS examples for CSS Widget:Image Caption
Add image caption to the left up corner
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> #container {<!-- w w w.j a v a 2s . co m--> margin: auto; width: 120px; } #img { margin-top: 20px; display: block; position:absolute; } #num { display: block; width: 40px; height: 30px; font-size: 16px; line-height: 30px; font-weight: bold; text-align: center; background-color: #f00; position:absolute; margin-left:-20px; margin-top: 5px; z-index:955; } </style> </head> <body> <div id="container"> <img id="img" src="https://www.java2s.com/style/demo/InternetExplorer.png"> <span id="num"> 99+ </span> </div> </body> </html>