From 074785cea106179cb3305637055ab0a009ca74f2 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:52 -0500 Subject: initial commit --- files/ru/web/css/transform-function/index.html | 207 +++++++++++++++++++++ .../web/css/transform-function/rotate()/index.html | 154 +++++++++++++++ .../css/transform-function/rotate3d()/index.html | 131 +++++++++++++ .../css/transform-function/scale3d()/index.html | 99 ++++++++++ .../web/css/transform-function/skew()/index.html | 117 ++++++++++++ 5 files changed, 708 insertions(+) create mode 100644 files/ru/web/css/transform-function/index.html create mode 100644 files/ru/web/css/transform-function/rotate()/index.html create mode 100644 files/ru/web/css/transform-function/rotate3d()/index.html create mode 100644 files/ru/web/css/transform-function/scale3d()/index.html create mode 100644 files/ru/web/css/transform-function/skew()/index.html (limited to 'files/ru/web/css/transform-function') diff --git a/files/ru/web/css/transform-function/index.html b/files/ru/web/css/transform-function/index.html new file mode 100644 index 0000000000..ac2d219b1f --- /dev/null +++ b/files/ru/web/css/transform-function/index.html @@ -0,0 +1,207 @@ +--- +title: +slug: Web/CSS/transform-function +tags: + - CSS + - CSS Data Type + - CSS Transforms + - Layout + - NeedsTranslation + - Reference + - TopicStub +translation_of: Web/CSS/transform-function +--- +
{{CSSRef}}
+ +

The <transform-function> CSS data type denotes a function used to modify an element's appearance. A transform can usually be expressed by matrices, with the result determined by using matrix multiplication on each point.

+ +

Coordinates for 2D graphics

+ +

Various coordinate models can be used to describe any transformation. The most common are the Cartesian coordinate system and homogeneous coordinates.

+ +

Cartesian coordinates

+ +

+ +

In the Cartesian coordinate system each point of Euclidian space is described using two values: the abscissa and the ordinate. In CSS (and most computer graphics), the origin (0, 0) is the top-left corner of any element. Each point is mathematically described using the vector notation (x, y).

+ +

Each linear function is described using a 2x2 matrix like:

+ +
+

ac bd

+
+ +

By using matrix multiplication with the linear function and each point in question, a transformation is created:

+ +
.
+ +

Note that it is possible to apply several transformations in a row:

+ +
.
+ +
 
+ +

With this notation, it is possible to describe, and therefore composite, most common transformations: rotations, scaling, or skewing. In fact, all transformations that are linear functions can be described. Composite transforms are effectively applied in order from right to left. However, one major transformation is not linear and therefore must be special-cased when using this notation: translation. The translation vector (tx, ty) must be expressed separately, as two additional parameters.

+ +

Möbius' homogeneous coordinates in projective geometry leading to 3x3 transformation matrices, though more complex and unusual for non-specialists, doesn't suffer from the translation limitation as these can be expressed as linear functions in this algebra, removing the need for special cases.

+ +

Functions defining transformations

+ +

Several functions are available to describe transformations in CSS. Each one applies a geometric operation, in 2D or 3D:

+ +
+
{{cssxref("transform-function/matrix","matrix()")}}
+
The matrix() CSS function specifies a homogeneous 2D transformation matrix comprised of the specified six values. The constant values of such matrices are implied and not passed as parameters; the other parameters are described in the column-major order.
+
matrix(a, b, c, d, tx, ty) is a shorthand for matrix3d(a, b, 0, 0, c, d, 0, 0, 0, 0, 1, 0, tx, ty, 0, 1).
+
{{cssxref("transform-function/matrix3d","matrix3d()")}}
+
The matrix3d() CSS function describes a 3D transform as a 4x4 homogeneous matrix. The 16 parameters are described in the column-major order.
+
{{cssxref("transform-function/perspective","perspective()")}}
+
The perspective() CSS function defines the distance between the z=0 plane and the user in order to give to the 3D-positioned element some perspective. Each 3D element with z>0 becomes larger; each 3D-element with z<0 becomes smaller. The strength of the effect is determined by the value of this property.
+
{{cssxref("transform-function/rotate","rotate()")}}
+
The rotate() CSS function defines a transformation that moves the element around a fixed point (as specified by the {{ Cssxref("transform-origin") }} property) without deforming it. The amount of movement is defined by the specified angle; if positive, the movement will be clockwise, if negative, it will be counter-clockwise. A rotation by 180° is called point reflection.
+
{{cssxref("transform-function/rotate3d","rotate3d()")}}
+
The rotate3d() CSS function defines a transformation that moves the element around a fixed axis without deforming it. The amount of movement is defined by the specified angle; if positive, the movement will be clockwise, if negative, it will be counter-clockwise.In opposition to rotations in the plane, the composition of 3D rotations is usually not commutative; it means that the order in which the rotations are applied is crucial.
+
{{cssxref("transform-function/rotateX","rotateX()")}}
+
The rotateX() CSS function defines a transformation that moves the element around the abscissa without deforming it. The amount of movement is defined by the specified angle; if positive, the movement will be clockwise, if negative, it will be counter-clockwise. The axis of rotation passes by the origin, defined by {{ cssxref("transform-origin") }} CSS property.
+
rotateX(a)is a shorthand for rotate3D(1, 0, 0, a).
+
{{cssxref("transform-function/rotateY","rotateY()")}}
+
The rotateY() CSS function defines a transformation that moves the element around the ordinate without deforming it. The amount of movement is defined by the specified angle; if positive, the movement will be clockwise, if negative, it will be counter-clockwise. The axis of rotation passes by the origin, defined by {{ cssxref("transform-origin") }} CSS property.
+
rotateY(a)is a shorthand for rotate3D(0, 1, 0, a).
+
{{cssxref("transform-function/rotateZ","rotateZ()")}}
+
The rotateZ() CSS function defines a transformation that moves the element around the z-axis without deforming it. The amount of movement is defined by the specified angle; if positive, the movement will be clockwise, if negative, it will be counter-clockwise. The axis of rotation passes by the origin, defined by {{ cssxref("transform-origin") }} CSS property.
+
rotateZ(a)is a shorthand for rotate3D(0, 0, 1, a).
+
{{cssxref("transform-function/scale","scale()")}}
+
The scale() CSS function modifies the size of the element. It can either augment or decrease its size and as the amount of scaling is defined by a vector, it can do so more in one direction than in another one. This transformation is characterized by a vector whose coordinates define how much scaling is done in each direction. If both coordinates of the vector are equal, the scaling is uniform, or isotropic, and the shape of the element is preserved. In that case, the scaling function defines a homothetic transformation.
+
{{cssxref("transform-function/scale3d","scale3d()")}}
+
The scale3d() CSS function modifies the size of an element. Because the amount of scaling is defined by a vector, it can resize different dimensions at different scales. This transformation is characterized by a vector whose coordinates define how much scaling is done in each direction. If all three coordinates of the vector are equal, the scaling is uniform, or isotropic, and the shape of the element is preserved. In that case, the scaling function defines a homothetic transformation.
+
{{cssxref("transform-function/scaleX","scaleX()")}}
+
The scaleX() CSS function modifies the abscissa of each element point by a constant factor, except if this scale factor is 1, in which case the function is the identity transform. The scaling is not isotropic and the angles of the element are not conserved. scaleX(-1) defines an axial symmetry with a vertical axis passing by the origin (as specified by the {{cssxref("transform-origin")}} property).
+
scaleX(sx) is a shorthand for scale(sx, 1) or for scale3d(sx, 1, 1).
+
{{cssxref("transform-function/scaleY","scaleY()")}}
+
The scaleY() CSS function modifies the ordinate of each element point by a constant factor except if this scale factor is 1, in which case the function is the identity transform. The scaling is not isotropic and the angles of the element are not conserved. scaleY(-1) defines an axial symmetry with a horizontal axis passing by the origin (as specified by the {{cssxref("transform-origin")}} property).
+
scaleY(sy) is a shorthand for scale(1, sy) or for scale3d(1, sy, 1).
+
{{cssxref("transform-function/scaleZ","scaleZ()")}}
+
The scaleZ() CSS function modifies the z-coordinate of each element point by a constant factor, except if this scale factor is 1, in which case the function is the identity transform. The scaling is not isotropic and the angles of the element are not conserved. scaleZ(-1) defines an axial symmetry along the z-axis passing by the origin (as specified by the {{cssxref("transform-origin")}} property).
+
scaleZ(sz) is a shorthand for scale3d(1, 1, sz).
+
{{cssxref("transform-function/skew","skew()")}}
+
The skew() CSS function is a shear mapping, or transvection, distorting each point of an element by a certain angle in each direction. It is done by increasing each coordinate by a value proportionate to the specified angle and to the distance to the origin. The more far from the origin, the more away the point is, the greater will be the value added to it.
+
{{cssxref("transform-function/skewX","skewX()")}}
+
The skewX() CSS function is a horizontal shear mapping distorting each point of an element by a certain angle in the horizontal direction. It is done by increasing the abscissa coordinate by a value proportionate to the specified angle and to the distance to the origin. The more far from the origin, the more away the point is, the greater will be the value added to it.
+
{{cssxref("transform-function/skewY","skewY()")}}
+
The skewY() CSS function is a vertical shear mapping distorting each point of an element by a certain angle in the vertical direction. It is done by increasing the ordinate coordinate by a value proportionate to the specified angle and to the distance to the origin. The more far from the origin, the more away the point is, the greater will be the value added to it.
+
{{cssxref("transform-function/translate","translate()")}}
+
The translate() CSS function moves the position of the element on the plane. This transformation is characterized by a vector whose coordinates define how much it moves in each direction.
+
{{cssxref("transform-function/translate3d","translate3d()")}}
+
The translate3d() CSS function moves the position of the element in the 3D space. This transformation is characterized by a 3-dimension vector whose coordinates define how much it moves in each direction.
+
{{cssxref("transform-function/translateX","translateX()")}}
+
The translateX() CSS function moves the element horizontally on the plane. This transformation is characterized by a {{cssxref("<length>")}} defining how much it moves horizontally.
+
translateX(tx) is a shorthand for translate(tx, 0).
+
{{cssxref("transform-function/translateY","translateY()")}}
+
The translateY() CSS function moves the element vertically on the plane. This transformation is characterized by a {{cssxref("<length>")}} defining how much it moves vertically.
+
translateY(ty) is a shorthand for translate(0, ty).
+
{{cssxref("transform-function/translateZ","translateZ()")}}
+
The translateZ() CSS function moves the element along the z-axis of the 3D space. This transformation is characterized by a {{cssxref("<length>")}} defining how much it moves.
+
translateZ(tz) is a shorthand for translate3d(0, 0, tz).
+
+ +

Specifications

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('CSS3 Transforms', '#transform-property', 'transform')}}{{Spec2('CSS3 Transforms')}}Initial definition.
+ +

Browser compatibility

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatGeckoDesktop("1.9.1")}}[1]9.0[2]10.53.1
3D Support12.0{{CompatGeckoDesktop("10.0")}}10.015.04.0
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatAndroid(2.1)}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}11.53.2
3D Support{{CompatAndroid(3.0)}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}223.2
+
+ +

[1] Gecko 14.0 removed the experimental support for skew(), but it was reintroduced in Gecko 15.0 for compatibility reasons. As it is non-standard and will likely be removed in the future, do not use it.

+ +

Before Firefox 16, the translation values of matrix() and matrix3d() could be {{cssxref("length")}} in addition to the standard {{cssxref("number")}}.

+ +

[2] Internet Explorer 5.5 or later supports a proprietary Matrix Filter which can be used to achieve a similar effect.

+ +

Internet Explorer 9.0 or earlier has no support for 3D transforms. Mixing 3D and 2D transform functions, such as -ms-transform: rotate(10deg) translateZ(0);, will prevent the entire property from being applied.

+ +

See also

+ + diff --git a/files/ru/web/css/transform-function/rotate()/index.html b/files/ru/web/css/transform-function/rotate()/index.html new file mode 100644 index 0000000000..71d94f55e7 --- /dev/null +++ b/files/ru/web/css/transform-function/rotate()/index.html @@ -0,0 +1,154 @@ +--- +title: rotate() +slug: Web/CSS/transform-function/rotate() +tags: + - CSS + - CSS трансформация + - CSS функция + - Reference + - Rotate + - transform +translation_of: Web/CSS/transform-function/rotate() +--- +
{{CSSRef}}
+ +

Функция CSS rotate () определяет преобразование, которое перемещает элемент вокруг неподвижной точки (как определено свойством {{Cssxref ("transform-origin")}}, не деформируя его. Количество движения определяется заданным углом; если положительно, движение будет по часовой стрелке, если оно отрицательное, оно будет против часовой стрелки. Вращение на 180 ° называется точечным отражением.

+ +

+ +

Синтаксис

+ +
rotate(a)
+
+ +

Значения

+ +
+
a
+
Является {{ cssxref("<angle>") }}, представляющим угол поворота. Положительный угол обозначает вращение по часовой стрелке, а отрицательный - против часовой стрелки.
+
+ + + + + + + + + + + + + + + + + + + + + +
Декартовы координаты на ℝ2Однородные координаты на ℝℙ2Декартовы координаты наℝ3Однородные координаты наℝℙ3
cos(a)-sin(a) sin(a)cos(a) cos(a)-sin(a)0sin(a)cos(a)0001 cos(a)-sin(a)0sin(a)cos(a)0001 cos(a)-sin(a)00sin(a)cos(a)0000100001
[cos(a) sin(a) -sin(a) cos(a) 0 0]
+ +

Примеры

+ +

Базовый пример

+ +

HTML

+ +
<div>Normal</div>
+<div class="rotated">Rotated</div>
+ +

CSS

+ +
div {
+  width: 80px;
+  height: 80px;
+  background-color: skyblue;
+}
+
+.rotated {
+  transform: rotate(45deg); /* Equal to rotateZ(45deg) */
+  background-color: pink;
+}
+ +

Result

+ +

{{EmbedLiveSample("Базовый_пример", "auto", 180)}}

+ +

Объединение вращения с другим преобразованием

+ +

Если вы хотите применить к элементу несколько преобразований, будьте осторожны с порядком, в котором вы указываете свои преобразования. Например, если вы вращаете перед сдвигом, сдвиг произойдёт относительно новой оси вращения!

+ +

HTML

+ +
<div>Normal</div>
+<div class="rotate">Rotated</div>
+<div class="rotate-translate">Rotated + Translated</div>
+<div class="translate-rotate">Translated + Rotated</div>
+
+ +

CSS

+ +
div {
+  position: absolute;
+  left: 40px;
+  top: 40px;
+  width: 100px;
+  height: 100px;
+  background-color: lightgray;
+}
+
+.rotate {
+  background-color: transparent;
+  outline: 2px dashed;
+  transform: rotate(45deg);
+}
+
+.rotate-translate {
+  background-color: pink;
+  transform: rotate(45deg) translateX(180px);
+}
+
+.translate-rotate {
+  background-color: gold;
+  transform: translateX(180px) rotate(45deg);
+}
+
+ +

Result

+ +

{{EmbedLiveSample("Объединение_вращения_с_другим_преобразованием", "auto", 320)}}

+ +

Спецификации

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName("CSS3 Transforms", "#funcdef-transform-rotate", "rotate()")}}{{Spec2("CSS3 Transforms")}}Initial definition
+ +

Поддержка браузерами

+ +

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.

+ +

{{Compat("css.properties.rotate")}}

+ +

Смотрите также

+ + diff --git a/files/ru/web/css/transform-function/rotate3d()/index.html b/files/ru/web/css/transform-function/rotate3d()/index.html new file mode 100644 index 0000000000..5558f3f69f --- /dev/null +++ b/files/ru/web/css/transform-function/rotate3d()/index.html @@ -0,0 +1,131 @@ +--- +title: rotate3d() +slug: Web/CSS/transform-function/rotate3d() +tags: + - CSS +translation_of: Web/CSS/transform-function/rotate3d() +--- +
{{CSSRef}}
+ +
Функция CSS rotate3d() трансформирует элемент без деформации, вращяя его в трехмерном пространстве вокруг зафиксированной оси. Её результатом является тип {{cssxref ("<transform-function>")}}.
+ +
 
+ +
{{EmbedInteractiveExample("pages/css/rotate3d.html")}}
+ + + +

In 3D space, rotations have three degrees of liberty, which together describe a single axis of rotation. The axis of rotation is defined by an [x, y, z] vector and pass by the origin (as defined by the {{ cssxref("transform-origin") }} property). If, as specified, the vector is not normalized (i.e., if the sum of the square of its three coordinates is not 1), the {{glossary("user agent")}} will normalize it internally. A non-normalizable vector, such as the null vector, [0, 0, 0], will cause the rotation to be ignored, but without invaliding the whole CSS property.

+ +
Note: Unlike rotations in the 2D plane, the composition of 3D rotations is usually not commutative. In other words, the order in which the rotations are applied impacts the result.
+ +

Syntax

+ +

The amount of rotation created by rotate3d() is specified by three {{cssxref("<number>")}}s and one {{cssxref("<angle>")}}. The <number>s represent the x-, y-, and z-coordinates of the vector denoting the axis of rotation. The <angle> represents the angle of rotation; if positive, the movement will be clockwise; if negative, it will be counter-clockwise.

+ +
rotate3d(x, y, z, a)
+
+ +

Values

+ +
+
x
+
Is a {{cssxref("<number>")}} describing the x-coordinate of the vector denoting the axis of rotation which could between 0 and 1.
+
y
+
Is a {{cssxref("<number>")}} describing the y-coordinate of the vector denoting the axis of rotation which could between 0 and 1.
+
z
+
Is a {{cssxref("<number>")}} describing the z-coordinate of the vector denoting the axis of rotation which could between 0 and 1.
+
a
+
Is an {{ cssxref("<angle>") }} representing the angle of the rotation. A positive angle denotes a clockwise rotation, a negative angle a counter-clockwise one.
+
+ + + + + + + + + + + + + + + + + + + +
Cartesian coordinates on ℝ2This transformation applies to the 3D space and can't be represented on the plane.
Homogeneous coordinates on ℝℙ2
Cartesian coordinates on ℝ3 1+(1-cos(a))(x2-1)z·sin(a)+xy(1-cos(a))-y·sin(a)+xz·(1-cos(a))-z·sin(a)+xy·(1-cos(a))1+(1-cos(a))(y2-1)x·sin(a)+yz·(1-cos(a))ysin(a) + xz(1-cos(a))-xsin(a)+yz(1-cos(a))1+(1-cos(a))(z2-1)t0001
Homogeneous coordinates on ℝℙ3
+ +

Examples

+ +

Rotating on the y-axis

+ +

HTML

+ +
<div>Normal</div>
+<div class="rotated">Rotated</div>
+ +

CSS

+ +
body {
+  perspective: 800px;
+}
+
+div {
+  width: 80px;
+  height: 80px;
+  background-color: skyblue;
+}
+
+.rotated {
+  transform: rotate3d(0, 1, 0, 60deg);
+  background-color: pink;
+}
+
+ +

Result

+ +

{{EmbedLiveSample("Rotating_on_the_y-axis", "auto", 180)}}

+ +

Rotating on a custom axis

+ +

HTML

+ +
<div>Normal</div>
+<div class="rotated">Rotated</div>
+ +

CSS

+ +
body {
+  perspective: 800px;
+}
+
+div {
+  width: 80px;
+  height: 80px;
+  background-color: skyblue;
+}
+
+.rotated {
+  transform: rotate3d(1, 2, -1, 192deg);
+  background-color: pink;
+}
+
+ +

Result

+ +

{{EmbedLiveSample("Rotating_on_a_custom_axis", "auto", 180)}}

+ +

Browser compatibility

+ +

Please see the <transform-function> data type for compatibility info.

+ +

See also

+ + diff --git a/files/ru/web/css/transform-function/scale3d()/index.html b/files/ru/web/css/transform-function/scale3d()/index.html new file mode 100644 index 0000000000..7caca80cca --- /dev/null +++ b/files/ru/web/css/transform-function/scale3d()/index.html @@ -0,0 +1,99 @@ +--- +title: scale3d() +slug: Web/CSS/transform-function/scale3d() +translation_of: Web/CSS/transform-function/scale3d() +--- +
{{CSSRef}}
+ +

scale3d() CSS функция изменяет размер элемента. Благодяря величине масштабирования определенной вектором, может изменять различные размеры в разных масштабах.

+ +

Это преобразование характеризуется вектором, координаты которого определяют, сколько масштабирования выполняется в каждом направлении. Если все три координаты вектора равны, масштабирование равномерно или изотропно, а форма элемента сохраняется. В этом случае функция масштабирования определяет гомотетическое преобразование.

+ +

Когда вне диапазона [-1, 1], масштабирование увеличивает элемент в направлении координаты; Когда внутри диапазона он сжимает элемент в этом направлении. При равном 1 он ничего не делает, а когда отрицательный, он выполняет точечное отражение и модификацию размера.

+ +

Синтаксис

+ +
scale3d(sx, sy, sz)
+
+ +

Значения

+ +
+
sx
+
Является  {{cssxref("<number>")}} , представляющим абсцисс вектора масштабирования.
+
sy
+
Является  {{cssxref("<number>")}} , представляющим ординату вектора масштабирования.
+
sz
+
Является  {{cssxref("<number>")}}, представляющим z-компонент масштабирующего вектора.
+
+ + + + + + + + + + + + + + + + + +
Cartesian coordinates on ℝ2Homogeneous coordinates on ℝℙ2Cartesian coordinates on ℝ3Homogeneous coordinates on ℝℙ3
Это преобразование применяется к пространству 3D и не может быть представлено на плоскости. sx000sy000sz sx0000sy0000sz00001
+ +

Примеры

+ +

Without changing the origin

+ +

HTML

+ +
<p>foo</p>
+<p class="transformed">bar</p>
+ +

CSS

+ +
p {
+  width: 50px;
+  height: 50px;
+  background-color: teal;
+}
+
+.transformed {
+  transform: perspective(500px) scale3d(0.8, 2, 0.2) translateZ(100px);
+  background-color: blue;
+}
+
+ +

Result

+ +

{{EmbedLiveSample("Without_changing_the_origin","100%","200")}}

+ +

Translating the origin of the transformation

+ +

HTML

+ +
<p>foo</p>
+<p class="transformed">bar</p>
+ +

CSS

+ +
p {
+  width: 50px;
+  height: 50px;
+  background-color: teal;
+}
+
+.transformed {
+  transform: scale3d(2, 3, 0);
+  transform-origin: center;
+  background-color: blue;
+}
+
+ +

Result

+ +

{{EmbedLiveSample("Translating_the_origin_of_the_transformation","100%","200")}}

diff --git a/files/ru/web/css/transform-function/skew()/index.html b/files/ru/web/css/transform-function/skew()/index.html new file mode 100644 index 0000000000..04ff2df26c --- /dev/null +++ b/files/ru/web/css/transform-function/skew()/index.html @@ -0,0 +1,117 @@ +--- +title: skew() +slug: Web/CSS/transform-function/skew() +translation_of: Web/CSS/transform-function/skew() +--- +
{{CSSRef}}
+ +

CSS функция skew() трансформирует элемент, наклоняя его в 2D-пространстве.

+ +
{{EmbedInteractiveExample("pages/css/function-skew.html")}}
+ + + +

Данная трансформация является линейным преобразованием векторного пространства (трансвекция или shear mapping), которое деформирует каждую точку элемента на определенный угол по горизонтали или вертикали. Координаты каждой точки изменяются на величину, пропорциональную указанному углу и расстоянию до точки, относительно которой выполняется трансформация (origin); таким образом, чем больше расстояние до смещаемой точки элемента, тем больше она будет смещена по горизонтали или вертикали.

+ +

Синтаксис

+ +

Функция skew() задается одним или двумя значениями которые отображают наклон в каждом из направлений.

+ +
skew(ax)
+
+skew(ax, ay)
+
+ +

Значения

+ +
+
ax
+
Указывается значение {{cssxref("<angle>")}}, которое является углом наклона вдоль оси X.
+
ay
+
Указывается значение {{cssxref("<angle>")}}, которое является углом наклона вдоль оси Y. Если данное значение не задано, то по умолчанию оно равно 0. В этом случае вертикального наклона не будет, а будет только горизонтальный.
+
+ + + + + + + + + + + + + + + + + + + + + +
Cartesian coordinates on ℝ2Homogeneous coordinates on ℝℙ2Cartesian coordinates on ℝ3Homogeneous coordinates on ℝℙ3
1tan(ax)tan(ay)1 1tan(ax)0tan(ay)10001 1tan(ax)0tan(ay)10001 1tan(ax)00tan(ay)10000100001
[1 tan(ay) tan(ax) 1 0 0]
+ +

Примеры

+ +

Используя только наклон по оси x

+ +

HTML

+ +
<div>Обычный</div>
+<div class="skewed">Наклоненный</div>
+ +

CSS

+ +
div {
+  width: 80px;
+  height: 80px;
+  background-color: skyblue;
+}
+
+.skewed {
+  transform: skew(10deg); /* Equal to skewX(10deg) */
+  background-color: pink;
+}
+
+ +

Result

+ +

{{EmbedLiveSample("Using_a_single_x-angle", 200, 200)}}

+ +

Используя два угла

+ +

HTML

+ +
<div>Обычный</div>
+<div class="skewed">Наклоненный</div>
+ +

CSS

+ +
div {
+  width: 80px;
+  height: 80px;
+  background-color: skyblue;
+}
+
+.skewed {
+  transform: skew(10deg, 10deg);
+  background-color: pink;
+}
+
+ +

Результат

+ +

{{EmbedLiveSample("Using_two_angles", 200, 200)}}

+ +

Поддержка браузеров

+ +

Please see the <transform-function> data type for compatibility info.

+ +

Смотрите так же

+ + -- cgit v1.2.3-54-g00ecf