[英][HTML CSS JS]Prevent user from changing values using before element
I want to block three tables with inputs using before selector. 我想使用前选择器阻止三个表的输入。 Via jquery i'm adding class disabled-element to every table: 通过jQuery,我在每个表中添加了类Disabled-element:
$("table").toggleClass("disabled-element");
Here is my disabled-element in css: 这是我在CSS中的禁用元素:
.disabled-element::before {
background-color: #4e555b;
opacity: 0.5;
z-index: 10;
position: absolute;
height: 100%;
width: 100%;
content: "";
}
table tructures: 表结构:
<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>
but it looks like the class is only added to selector: 但看起来该类仅添加到选择器中:
我错过了position: relative
父元素的position: relative
声明
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.