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

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

    In order to do this, you can set the HEIGHT of your "a" element in pixels instead of percentage.

    If you specify a percentage, 100% will end up being the height of the TEXT itself.

    A pixel height will give you a static height, and will work for this situation.

    td a {height: 100px;}
    

提交回复
热议问题