首页 > 解决方案 > 为什么`backface-visibility:hidden` 在 iframe 上不起作用?

问题描述

背面可见性不会隐藏 iframe 背面

我创建了一个两边都有 iframe 元素的翻转框,当翻转时,正面的 iframe 将覆盖背面的 iframe,应用backface-visibility: hidden不会隐藏它的背面,虽然它应该是

代码笔链接

<div class="flip3D">
     <div class="front">
        <iframe id ="frame" width="auto" height="auto" src="https://www.youtube.com/embed/wZZ7oFKsKzY?enablejsapi=1" frameborder="0"> 
        </iframe>
     </div>
     <div class="end">
        <iframe width="80%" height="80%" src="https://www.youtube.com/embed/tgbNymZ7vqY" frameborder="0"></iframe>    
     </div>
</div>

我可以通过使前端 iframe 可见性来解决此问题:悬停时隐藏。但

问题:为什么backface-visibility不工作iframe

标签: htmlcssiframe

解决方案


你失踪了transform-style:preserve-3d;


推荐阅读