HTML CSS examples for CSS Widget:Image Caption
Add caption to image with div
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .pbtable {<!-- w w w . j a va 2 s . c om--> display:table; margin:0 auto; width:501px; } .pbrow { display:table-row; } .pbcell { display:table-cell; } </style> </head> <body> <div class="pbtable"> <div class="pbrow"> <div class="pbcell"> <img src="https://www.java2s.com/style/demo/Opera.png" height="200px"> </div> <div class="pbcell"> <img src="https://www.java2s.com/style/demo/Opera.png" height="200px"> </div> </div> <div class="pbrow"> <div class="pbcell"> Lorem ipsum dolor si </div> <div class="pbcell"> Lorem ipsum d </div> </div> </div> </body> </html>