css - 从孩子身上移除变换和透视。not() 和重新指定不起作用
问题描述
https://jsfiddle.net/98uo6h2e/2/
所以我用下面的代码做了一个透视效果。我想排除 .hello2 仅使用 CSS 采用变换和/或透视效果。我该怎么做呢?
已经尝试在 .hello 中将转换和 webkit 重新指定为 none/unset/initial 没有发生任何事情。
<table id="hello">
<tbody>
<tr>
<td>
<div class="hello2">
<strong>Test</strong>
<h2>Test2</h2>
</div>
</td>
</tr>
</tbody>
</table>
table#hello:not(.hello2) {
-webkit-perspective-origin: center top;
-webkit-perspective: 100;
}
tbody:not(.hello2) {
transform: rotate3d(0.1, 0, 0, 40deg);
-webkit-transform-origin: center top;
}
.hello2 {
-webkit-transform-origin: initial;
-webkit-perspective-origin: initial;
-webkit-perspective: initial;
}
解决方案
您可以使用:not
选择器。
table#hello:not(.hello2) {
-webkit-perspective-origin: center top;
-webkit-perspective: 100;
}
tbody:not(.hello2) {
transform: rotate3d(0.1, 0, 0, 40deg);
-webkit-transform-origin: center top;
}
推荐阅读
- input - 怎么获得粘贴后的值?
- json - Groovy - JSON 输出不完全符合要求
- java - AWS Lambda 将实施 Java 17
- r - 在 R 的 gt 表中创建存根时出错 - 导致错误
- c# - NEST 批量插入后等待服务器完成索引
- acumatica - 找不到状态字段的映射
- python-3.x - TypeError: __init__() 在 Node2Vec 中得到了一个意外的关键字参数 'size'
- reactjs - 错误:NOT NULL 约束失败:places.id(代码 1299 SQLITE_CONSTRAINT_NOTNULL)
- java - 如何从 Spring-boot 向 Azure FHIR 发送 GET 请求?
- prometheus - 如何在特定时间段内聚合普罗米修斯计数器