If you add a cell to the table row, for example:
<div id="content"> <div id="top">TOP</div> <div id="center"> <div>CENTER</div> </div> </div>β
Then the following CSS works:
#center{ display:table-row; } #center > div { display: table-cell; border:solid #55A 1px; background-color:#AAF; height:100%; }
JS Fiddle demo .
It is important to remember that the browser will display the item as you tell it; therefore, if you tell div
- display: table-row
, it will be displayed in this way; and a table-row
does not have border
. table-cell
, however, so I added a child div
and assigned the display
property to it.
source share