当前位置: 首页>>编程示例 >>用法及示例精选 >>正文


CSS matrix3d()用法及代码示例

matrix3d()函数是一个内置函数,用于应用变换以将3D变换创建为4×4齐次矩阵。

用法:

matrix3d( a1, b1, c1, d1, a2, b2, c2, d2, a3, b3, c3, d3, a4, b4, c4, d4 )

参数:该函数接受上面提到和下面描述的16个参数:


  • a1,b1,c1,d1,a2,b2,c2,d2,a3,b3,c3,d3,d4:这些参数用于保存线性变换的值。
  • a4,b4,c4:这些参数用于保存转换值。

下面的示例说明了CSS中的matrix3d()函数:
例:

<!DOCTYPE html>  
<html>  
<head>  
    <title> 
        CSS matrix3d() function 
        </title>  
          
    <style>  
        .GFG {  
            transform:matrix3d( 
                0.6, 0.1, 0.7, 0, 
                -0.5, 0.8, 0.1, 0, 
                -0.6, -0.5, 0.5, 0, 
                0, 0, 0, 1 
            ); 
              
            font-size:26px; 
            font-weight:bold; 
            width:250px; 
            padding:20px; 
            background:green; 
            color:white; 
            font-family:sans-serif; 
        }  
    </style>  
      
</head>  
  
<body>  
    <center> 
        <h1 style="color:green">GeeksforGeeks</h1>  
        <h2>CSS matrix3d() function</h2>  
        <br><br>  
      
        <div class="GFG"> 
            Welcome to GeeksforGeeks 
        </div>  
    </center> 
</body>  
  
</html>                    

输出:

支持的浏览器:下面列出了matrix3d()函数支持的浏览器:

  • 谷歌浏览器
  • IE浏览器
  • 火狐浏览器
  • 苹果浏览器
  • Opera


相关用法


注:本文由纯净天空筛选整理自jit_t大神的英文原创作品 CSS | matrix3d() Function。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。