Making a
inherit the height of parent () using only css?

后端 未结 2 772
梦如初夏
梦如初夏 2020-12-20 19:04

http://jsfiddle.net/ZAvDd/

As my table row grows in height, I\'d like my div inside to automatically match it as well.

For the code above, my div

2条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-20 19:42

    What is the purpose of your div?

    Your div has currently a height of 0 (zero) because it's empty. What you can do is apply the style directly to your parent td by adding a class to it:

    
    

    And style it accordingly:

    .bar { background: gray;}
    

    It really depends on the purpose of your div.

提交回复
热议问题