我需要红色 div 来填充具有蓝色背景的父级。 http://jsfiddle.net/jiantongc/kyR8q/
尝试了对 .rowlevel2-deco
的各种修复,但没有奏效:
height:100%;
box-sizing: border-box;
等
类似问题:Chrome doesn't honor row height if rowspan is present但没有实际可行的解决方案。
最佳答案
.rowlevel2-deco{
display: inline-block;
padding: 0;
}
似乎有效。 http://jsfiddle.net/kyR8q/27/此外,要垂直居中,请使用:
.rowlevel2-deco:before {
content: '';
display: inline-block;
height: 100%;
vertical-align: middle;
}
关于html - 仅 CSS : <div> that fills up <th> parent,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22494158/