代码之家  ›  专栏  ›  技术社区  ›  rishubk

模糊除div中的一个元素外的所有元素

  •  5
  • rishubk  · 技术社区  · 7 年前

    我看过很多类似的问题 one 我明白了:

    .table-responsive:not(.confirm) {
        filter: blur(3px);
        pointer-events: none;
    }
    

    这基本上应该模糊除confirm类之外的所有元素。下面是一个js小提琴演示: https://jsfiddle.net/qbuyuhts/1/

    1 回复  |  直到 7 年前
        1
  •  4
  •   Ehsan    7 年前

    .table-responsive:not(.confirm) { .table-responsive 没有上课 .confirm 这是错误的,因为 证实 是的孩子 .表格响应 .

    .table-responsive table, .table-responsive div:not(.confirm) {
        filter: blur(3px);
         pointer-events: none;
    }
    

    .table-responsive table, .table-responsive div:not(.confirm) {
      filter: blur(3px);
      pointer-events: none;
    }
    <div style="border: none; overflow-x: visible;" class="table-responsive">
    
      <div style="background-color:white; width:35%; position:absolute; left:34%;" class="confirm">
        <h3 style="color:black">Are you sure?</h3>
        <button style="background-color:black;color:blue">Cancel</button>
        <button style="background-color:black;color:blue">Confirm</button>
      </div>
    
      <table id="tbl" style="width:100%">
        <tbody style="display: block; overflow-y: auto">
          <tr>
            <td style="padding-right:1em"><a class="remove"><button>Remove</button></a></td>
            <td style="padding-right:1em"><a><button>Edit</button></a></td>
            <td class="coursetext"><h4 align="left"><b>{{ course }}</b><br><span class="tohide"><b>{{ sections }}</b></span></h4><hr></td>
          </tr>
        </tbody>
      </table>
      
    </div>