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

前端 未结 5 1270
南笙
南笙 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:45

    You can use trick with color:transparent and to prevent events(of a) use pointer-events: none;

    #tableRow{
      display: table-row;
      background-color: red;
    }
    .cell{
      display:table-cell;
    }
    #hide{
      color:transparent;
      pointer-events: none;
    }

    With inputs:

        #tableRow{
          display: table-row;
          background-color: red;
        }
        .cell{
          display:table-cell;
        }
        #hide{
          color:transparent;
          pointer-events: none;
          border:none;
          outline:0;
          padding: 2px;
        }

提交回复
热议问题