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

后端 未结 7 2005
粉色の甜心
粉色の甜心 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:49

    You need to give the a height, so that your style block will end up something like

    th {
      font-size: 50%;
      width: 20em;
      height: 8ex;
      line-height: 100%;
    }
    

    Edit: Actually, for height you should probably use a vertical measure like "ex", instead of a horizontal measure of "em". Example changed to reflect that.

提交回复
热议问题