要確定一個元素在不面向螢幕時是否可見,請使用backface-visibility屬性:
#即時示範
<!DOCTYPE html> <html> <head> <style> .demo1 { position: relative; width: 150px; height: 150px; background-color: yellow; perspective: 80px; margin: 50px; perspective-origin: left; transform: rotateY(180deg); } .demo2 { position: absolute; padding: 20px; background-color: orange; transform-style: preserve-3d; transform: rotateX(45deg); backface-visibility: visible; } </style> </head> <body> <h1>Rotation</h1> <div class = "demo1">Demo <div class = "demo2">Demo</div> </div> </body> </html>
以上是用 CSS 確定元素在不面向螢幕時是否可見的詳細內容。更多資訊請關注PHP中文網其他相關文章!