matrix()函數是一個內置函數,用於創建同構2D轉換矩陣。
用法:
matrix( a, b, c, d, tx, ty )
參數:該函數接受上述和以下所述的六個參數:
- A B C D:這些參數用於描述線性變換。
- tx:此參數用於描述x軸上的線性平移。
- ty:此參數用於描述y軸上的線性平移。
下麵的示例說明了CSS中的matrix()函數:示例:
<!DOCTYPE html>
<html>
<head>
<title>
CSS matrix() function
</title>
<style>
body {
text-align:center;
}
h1 {
color:green;
}
.GFG {
transform-origin:0 0;
transform:matrix(0.8, 0.8, -0.8, 0.8, 250, -30);
font-size:26px;
font-weight:bold;
width:250px;
padding:20px;
background:green;
color:white;
font-family:sans-serif;
}
</style>
</head>
<body>
<h1>GeeksforGeeks</h1>
<h2>CSS matrix() function</h2>
<br>
<br>
<div class="GFG">
Welcome to GeeksforGeeks
</div>
</body>
</html>
輸出:
支持的瀏覽器:matrix()函數支持的瀏覽器如下:
- 穀歌瀏覽器
- IE瀏覽器
- 火狐瀏覽器
- 蘋果瀏覽器
- Opera
相關用法
- CSS rgb()用法及代碼示例
- p5.js nfs()用法及代碼示例
- d3.js d3.rgb()用法及代碼示例
- p5.js second()用法及代碼示例
- p5.js pow()用法及代碼示例
- d3.js d3.map.has()用法及代碼示例
- d3.js d3.set.add()用法及代碼示例
- p5.js max()用法及代碼示例
- PHP dir()用法及代碼示例
- d3.js d3.map.get()用法及代碼示例
- p5.js sq()用法及代碼示例
- p5.js red()用法及代碼示例
注:本文由純淨天空篩選整理自jit_t大神的英文原創作品 CSS | matrix() Function。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。