Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

blur all elements except one in a div

Tags:

I am trying to blur all elements in a div except one. I have looked at many similar questions like this one and I get this:

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

This is basically supposed to blur all elements except the confirm class. Here is a js fiddle demonstrating it: https://jsfiddle.net/qbuyuhts/1/

It's some janky html but does the job to show the problem. Does anyone know why the .confirm div is blurring?

like image 850
rishubk Avatar asked Jul 22 '17 01:07

rishubk


1 Answers

.table-responsive:not(.confirm) { selects element that have class .table-responsive and have not class .confirm this is wrong ,because .confirm is children of .table-responsive.

So change your code like this:

.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>
like image 109
Ehsan Avatar answered Oct 11 '22 12:10

Ehsan