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

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

    The closest i got was this...

    th {
      float: left;
      overflow: hidden;
      font-size: 50%;
      width: 20em;
      margin: auto;
    }
    th a {
      display: table; /* or block, up to you */
      margin: none;
      width:100%;
      height: 1px;
      background-color: #aaa;
      padding: 20%;
    }
    

    But it makes all your rows the same height. Maybe someone else can fix that if it's a problem.

    0 讨论(0)
提交回复
热议问题