From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../css/transform-function/translatex/index.html | 109 +++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 files/fr/web/css/transform-function/translatex/index.html (limited to 'files/fr/web/css/transform-function/translatex/index.html') diff --git a/files/fr/web/css/transform-function/translatex/index.html b/files/fr/web/css/transform-function/translatex/index.html new file mode 100644 index 0000000000..76f583c665 --- /dev/null +++ b/files/fr/web/css/transform-function/translatex/index.html @@ -0,0 +1,109 @@ +--- +title: translateX() +slug: Web/CSS/transform-function/translateX +tags: + - CSS + - Fonction + - Reference + - Transformations CSS +translation_of: Web/CSS/transform-function/translateX +--- +
{{CSSRef}}
+ +

La fonction translateX() permet de déplacer un élément horizontalement. Cette transformation est caractérisée par une longueur (type {{cssxref("<length>")}}) qui définit l'amplitude du mouvement horizontal. La valeur obtenue par cette fonction est de type {{cssxref("<transform-function>")}}.

+ +

+ +

translateX(tx) est une notation raccourcie équivalente à translate(tx, 0).

+ +

Syntaxe

+ +
translateX(t)
+
+ +

Valeurs

+ +
+
t
+
Une valeur de type {{cssxref("<length>")}} qui représente l'abscisse (la coordonnée en X) du vecteur de translation.
+
+ + + + + + + + + + + + + + + + + + + + + +
Coordonnées cartésiennes sur ℝ2Coordonnées homogènes sur ℝℙ2Coordonnées cartésiennes sur ℝ3Coordonnées homogènes sur ℝℙ3
+

Une translation n'est pas une transformation linéaire sur ℝ2 et on ne peut donc pas la représenter en utilisant une matrice exprimée dans le système cartésien.

+
10t010001 10t010001 100t010000100001
[1 0 0 1 t 0]
+ +

Exemples

+ +

HTML

+ +
<p>toto</p>
+<p class="transformation">truc</p>
+<p>toto</p>
+ +

CSS

+ +
p {
+  width: 50px;
+  height: 50px;
+  background-color: teal;
+}
+
+.transformation {
+  transform: translateX(10px);
+  background-color: blue;
+}
+
+ +

Résultat

+ +

{{EmbedLiveSample("Exemples","100%","250")}}

+ +

Spécifications

+ + + + + + + + + + + + + + + + +
SpécificationÉtatCommentaires
{{SpecName("CSS3 Transforms", "#funcdef-transform-translatex", "translateX()")}}{{Spec2("CSS3 Transforms")}}Définition initiale.
+ +

Compatibilité des navigateurs

+ +

Voir la page sur le type de donnée <transform-function> pour les informations de compatibilité associées.

+ +

Voir aussi

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