Computer >> Hướng Dẫn Máy Tính >  >> Lập Trình >> CSS

Hàm CSS3 matrix3d() - Ma trận biến đổi 3D


Hàm matrix3d() trong CSS dùng để định nghĩa ma trận biến đổi 3D đồng nhất 4x4.

Ví dụ

<!DOCTYPE html> <html> <head> <style> .demo_img {    transform: matrix3d(1,1,0,0,0,1,0,0,0,0,1,0,1,100,0,1); } </style> </head> <body> <h1>Learn</h1> <p>Learn Apache Spark</p> <img class="demo_img" src= "https://www.tutorialspoint.com/machine_learning/images/machine-learning-mini-logo.jpg" alt="Apache Spark"> </body> </html>

Kết quả

Hàm CSS3 matrix3d() - Ma trận biến đổi 3D

Ví dụ khác

<!DOCTYPE html> <html> <head> <style> .demo_img {    transform: matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,50,-100,0,1.1); </style> </head> <body> <h1>Learn</h1> <p>Learn Apache Spark</p> <img class="demo_img" src= "https://www.tutorialspoint.com/machine_learning/images/machine-learning-mini-logo.jpg" alt="Apache Spark"> </body> </html>

Kết quả

Hàm CSS3 matrix3d() - Ma trận biến đổi 3D