visiblity:hidden of table-cell hides background-color of parent table-row

前端 未结 5 1252
南笙
南笙 2021-01-18 10:13

I have some forms that are structured using display:table-row and display: table-cell. On Firefox 52, I could hide a cell element using visib

5条回答
  •  滥情空心
    2021-01-18 10:58

    I would consider box-shadow to simulate a background coloration and avoid this bug *

    .container {
      display: table;
    }
    
    #tableRow {
      display: table-row;
      box-shadow: -100vw 0 0 red inset;
    }
    
    .cell {
      display: table-cell;
      padding: 10px;
    }
    
    #hide {
      visibility: hidden;
    }

    *it's probably not a bug but I am not able to find any specification describing this behavior

提交回复
热议问题