我想在选择器之前使用输入阻止三个表。通过jquery我将class disabled-元素添加到每个表:
$("table").toggleClass("disabled-element");
这是我在css中的disabled-element:
.disabled-element::before {
background-color: #4e555b;
opacity: 0.5;
z-index: 10;
position: absolute;
height: 100%;
width: 100%;
content: "";
}
表结构:
<table class="table table-stripped">
<thead>
<th scope="col">Rotor Number</th>
<th scope="col">Current values</th>
</thead>
</table>
<tbody>
<tr>
<td></td><td></td>
</tr>
</tbody>
我错过了父母元素的position: relative
声明