skewX()

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2015.

Die skewX() CSS Funktion definiert eine Transformation, die ein Element auf der 2D-Ebene in horizontaler Richtung schräg stellt. Das Ergebnis ist ein <transform-function> Datentyp.

Probieren Sie es aus

Diese Transformation ist eine Scherung (Transvektion), die jeden Punkt innerhalb eines Elements um einen bestimmten Winkel in horizontaler Richtung verzerrt. Die Abszisse (horizontal, x-Koordinate) jedes Punktes wird um einen Wert modifiziert, der proportional zum angegebenen Winkel und zur Entfernung zum Ursprung ist; daher gilt: Je weiter entfernt ein Punkt vom Ursprung ist, desto größer wird der hinzukommende Wert sein.

Note: skewX(a) ist gleichbedeutend mit skew(a).

Syntax

css
skewX(a)

Werte

a

Ist ein <angle>, der den Winkel darstellt, um das Element entlang der Abszisse (horizontal, x-Koordinate) zu verzerren.

Kartesische Koordinaten auf ℝ^2 Homogene Koordinaten auf ℝℙ^2 Kartesische Koordinaten auf ℝ^3 Homogene Koordinaten auf ℝℙ^3
(1tan(a)01)\left( \begin{array}{cc} 1 & \tan(a) \\ 0 & 1 \end{array} \right)
(1tan(a)0010001)\left( \begin{array}{ccc} 1 & \tan(a) & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{array} \right)
(1tan(a)0010001)\left( \begin{array}{ccc} 1 & \tan(a) & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{array} \right)
(1tan(a)00010000100001)\left( \begin{array}{cccc} 1 & \tan(a) & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{array} \right)
[1 0 tan(a) 1 0 0]

Formale Syntax

<skewX()> = 
skewX( [ <angle> | <zero> ] )

Beispiele

HTML

html
<div>Normal</div>
<div class="skewed">Skewed</div>

CSS

css
div {
  width: 80px;
  height: 80px;
  background-color: skyblue;
}

.skewed {
  transform: skewX(10deg); /* Equal to skew(10deg) */
  background-color: pink;
}

Ergebnis

Spezifikationen

Specification
CSS Transforms Module Level 1
# funcdef-transform-skewx

Browser-Kompatibilität

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
skewX()

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

Siehe auch