CSS: Make a block element fill the entire space of a parent element?

后端 未结 7 1996
粉色の甜心
粉色の甜心 2020-12-18 18:11

I am trying to put a link in a element and have the element fill the entire space of the . While I can

7条回答
  •  遥遥无期
    2020-12-18 18:43

    The th element needs to have a height assigned to it. Giving it a height of 100% should cause the element to expand to the height of its container (i.e. the height of the row). This may not work properly in IE 6, you may try adding _height: 1% to address IE6 - I don't have IE6 to test this with, but I tested in Firefox and it appears to be doing what you want.

    th {
      height: 100%;
    }
    

提交回复
热议问题