用 CSS 确定元素在不面向屏幕时是否可见
要确定一个元素在不面向屏幕时是否可见,请使用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 确定元素在不面向屏幕时是否可见的详细内容,更多请关注双恒网络其它相关文章!
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。



