transform perspective顺序问题,perspective需要在前面

来源:互联网 发布:psd 电力系统仿真软件 编辑:程序博客网 时间:2024/05/29 17:14

一定要将perspective 放置在第一位,否者不生效



错误的写法如下: 会导致不产生透视效果perspective 无效

            transform:rotateX(30deg)  perspective(20px);



demo

<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset="gbk">
    <style type="text/css">

        .wyFirst {
            width: 100px;
            height: 100px;
            background-color: red;
            position: absolute;
            left: 100px;
            top: 100px;
            transform:perspective(20px) rotateX(30deg) ;

        }
    </style>
</head>
<body>
<div class="wyFirst">this is a test</div>
</body>
</html>

0 0