You must insert the contents of the DIV into the yellow DIV :
<div class="yellow"><div class="content">Hello</div></div>
[EDIT] This has a drawback: the internal DIV will be limited to the yellow DIV (ie, it will use only 50% of the page width).
So we need another DIV , absolute positioning and z-index:
<html> <head> <style type='text/css'> td.green { background-color: green; padding: 0px; margin: 0px; height:100%; text-align:center } div.yellow { position:absolute; left:0px; top:0px; width: 50%; height: 100%; background-color:yellow } div.container { position:relative; height: 100%; } div.content { position:relative; z-index:1; } </style> </head> <body style="width: 100%"> <table style="width: 25%; height: 150px;"> <tr style="padding: 0px; margin: 0px"> <td class="green"> <div class="container"> <div class="content">Hello</div> <div class="yellow"></div> </div> </td> </tr> </table> </body> </html>
Works with FF 3.6.
source share