CSS 3D Dönüşümleri
CSS 3D Dönüşümleri
CSS ayrıca 3B dönüşümleri de destekler.
2B ve 3B dönüşüm arasındaki farkı görmek için fareyi aşağıdaki öğelerin üzerine getirin:
2D döndürme
3D döndürme
Bu bölümde aşağıdaki CSS özelliği hakkında bilgi edineceksiniz:
transform
Tarayıcı Desteği
Tablodaki sayılar, özelliği tam olarak destekleyen ilk tarayıcı sürümünü belirtir.
Property | |||||
---|---|---|---|---|---|
transform | 36.0 |
10.0 |
16.0 |
9.0 |
23.0 |
CSS 3D Dönüşüm Yöntemleri
CSS transform
özelliği ile aşağıdaki 3B dönüştürme yöntemlerini kullanabilirsiniz:
rotateX()
rotateY()
rotateZ()
döndürmeX() Yöntemi
Yöntem rotateX()
, bir öğeyi belirli bir derecede X ekseni etrafında döndürür:
Örnek
#myDiv
{
transform: rotateX(150deg);
}
döndürmeY() Yöntemi
Yöntem rotateY()
, bir öğeyi Y ekseni etrafında belirli bir derecede döndürür:
Örnek
#myDiv
{
transform: rotateY(150deg);
}
döndürmeZ() Yöntemi
Yöntem rotateZ()
, bir öğeyi belirli bir derecede Z ekseni etrafında döndürür:
Örnek
#myDiv
{
transform: rotateZ(90deg);
}
CSS Dönüştürme Özellikleri
Aşağıdaki tablo, tüm 3B dönüştürme özelliklerini listeler:
Property | Description |
---|---|
transform | Applies a 2D or 3D transformation to an element |
transform-origin | Allows you to change the position on transformed elements |
transform-style | Specifies how nested elements are rendered in 3D space |
perspective | Specifies the perspective on how 3D elements are viewed |
perspective-origin | Specifies the bottom position of 3D elements |
backface-visibility | Defines whether or not an element should be visible when not facing the screen |
CSS 3D Dönüştürme Yöntemleri
Function | Description |
---|---|
matrix3d (n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n) |
Defines a 3D transformation, using a 4x4 matrix of 16 values |
translate3d(x,y,z) | Defines a 3D translation |
translateX(x) | Defines a 3D translation, using only the value for the X-axis |
translateY(y) | Defines a 3D translation, using only the value for the Y-axis |
translateZ(z) | Defines a 3D translation, using only the value for the Z-axis |
scale3d(x,y,z) | Defines a 3D scale transformation |
scaleX(x) | Defines a 3D scale transformation by giving a value for the X-axis |
scaleY(y) | Defines a 3D scale transformation by giving a value for the Y-axis |
scaleZ(z) | Defines a 3D scale transformation by giving a value for the Z-axis |
rotate3d(x,y,z,angle) | Defines a 3D rotation |
rotateX(angle) | Defines a 3D rotation along the X-axis |
rotateY(angle) | Defines a 3D rotation along the Y-axis |
rotateZ(angle) | Defines a 3D rotation along the Z-axis |
perspective(n) | Defines a perspective view for a 3D transformed element |