HTML CSS examples for CSS Layout:Relative Position
Position absolute inside a relative container
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> td {<!-- w w w . j a va 2s . c o m--> width:51px; height:51px; background:Chartreuse; border:6px solid yellow; } </style> </head> <body> <table cellpadding="0" cellspacing="0"> <tbody> <tr> <td> <div style="position:relative"> <div style="position:absolute"> Lorem </div> </div> </td> <td> <div style="position:relative"> <div style="position:absolute"> Lorem </div> </div> </td> </tr> <tr> <td> <div style="position:relative"> <div style="position:absolute"> Lorem </div> </div> </td> <td> <div style="position:relative"> <div style="position:absolute"> Lorem </div> </div> </td> </tr> <tr> <td> <div style="position:relative"> <div style="position:absolute"> Lorem </div> </div> </td> <td> <div style="position:relative"> <div style="position:absolute"> Lorem </div> </div> </td> </tr> </tbody> </table> </body> </html>