简体   繁体   English

更改了通用兄弟组合器以切换伪元素:有效的是

[英]changed general-sibling combinator for toggling pseudo-element: what is valid

I've hit the frequently mentioned WebKit bug. 我遇到了经常提到的WebKit错误。 The following workaround seems to work in specific instances . 以下变通办法似乎在特定情况下可行 However I am not succeeding in finding the valid combinations. 但是,我没有找到有效的组合。

Starting with (shortened. the actual code has 9 child elements to create a carousel): 以开始(缩短。实际代码有9个子元素来创建轮播):

    input[value="1"]:checked ~ .container .carousel p:nth-child(1) { -webkit-transform: translateZ(540px) scale(1); opacity: 1; }

I've attempted the syntax suggested in the link 我尝试了链接中建议的语法

    input[value="1"]:checked + .container + .carousel p:nth-child(1) { -webkit-transform: translateZ(540px) scale(1); opacity: 1; }

However that disables the toggled action. 但是,这将禁用切换操作。

* update * *更新*
As pointed out, I did not properly specify the problem. 如前所述,我没有正确指定问题。

The issue is that the checkbox hack is not working on Android < 4.1 (as far as I can tell). 问题是复选框黑客无法在Android <4.1上运行(据我所知)。
Using Chrome or Safari (Firefox is not properly functioning with the code, and is being rendered separately) the result of the code can be seen here 使用Chrome或Safari(Firefox无法正常使用该代码,并且正在单独呈现) ,可以在此处查看代码结果

See jsFiddle Example . 参见jsFiddle示例 This worked for me 这对我有用

input[value="1"]:checked + .container .carousel p:nth-child(1) 
    { -webkit-transform: translateZ(540px) scale(1); opacity: 1; }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM