1

HTML TREE STRUCTURE

I have html tree structure as shown in above image. I am applying following CSS to this html tree structure but it is not working.

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

My output is like this: enter image description here

Entire page gets blur, including the activerow class. I want to blur entire blur class except activerow class

karan patel
  • 61
  • 1
  • 7

2 Answers2

1

You need to use :not with the target element class, which in your case is tr

.blur tr:not(.activerow) {
  filter: blur(3px);
  pointer-events: none;
}

.activerow {
  color: red;
}
<div class="blur">
  <table style="width:100%">
    <tr class="activerow">
      <th>Firstname</th>
      <th>Lastname</th>
      <th>Age</th>
    </tr>
    <tr>
      <td>Jill</td>
      <td>Smith</td>
      <td>50</td>
    </tr>
    <tr>
      <td>Eve</td>
      <td>Jackson</td>
      <td>94</td>
    </tr>
  </table>
</div>
Nidhin Joseph
  • 9,981
  • 4
  • 26
  • 48
1

You are applying the blur effect to a parent to all the rows, so excluding a row doesn't help. You need to apply the effect to each row and exclude the ones you don't want:

.blur tr:not(.activerow){
  filter: blur(3px);
  pointer-events: none;
} 
<div class="blur">
  <table>
    <tr><td>one</td><tr>
    <tr class="activerow"><td>two</td><tr>
    <tr><td>three</td><tr>
    <tr><td>four</td><tr>
  </table>
</div>
VLAZ
  • 26,331
  • 9
  • 49
  • 67