From a81cea7d8b08d1765dcc5ea62e6238dd1d596a05 Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO Date: Tue, 23 Nov 2021 02:21:04 +0900 Subject: CSS 座標変換関数のリファレンスを更新 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 2021/11/21 時点の英語版に同期 --- .../css/transform-function/translatex()/index.md | 199 +++++++++++++-------- 1 file changed, 121 insertions(+), 78 deletions(-) (limited to 'files/ja/web/css/transform-function/translatex()') diff --git a/files/ja/web/css/transform-function/translatex()/index.md b/files/ja/web/css/transform-function/translatex()/index.md index 89f2ee7199..1d0797b735 100644 --- a/files/ja/web/css/transform-function/translatex()/index.md +++ b/files/ja/web/css/transform-function/translatex()/index.md @@ -1,79 +1,137 @@ --- title: translateX() -slug: orphaned/Web/CSS/transform-function/translateX +slug: Web/CSS/transform-function/translateX() tags: - CSS - - CSS Function - - CSS Transforms - - Function - - Reference -translation_of: Web/CSS/transform-function/translateX + - CSS 関数 + - CSS 座標変換 + - 関数 + - リファレンス +browser-compat: css.types.transform-function.translateX +translation_of: Web/CSS/transform-function/translateX() original_slug: Web/CSS/transform-function/translateX --- -
{{CSSRef}}
+{{CSSRef}} -

translateX()CSSfunctionで、要素を二次元平面上の水平方向で再配置します。結果は {{cssxref("<transform-function>")}} データ型になります。

+**`translateX()`** は [CSS](/ja/docs/Web/CSS) の[関数](/ja/docs/Web/CSS/CSS_Functions)で、要素を二次元平面上の水平方向で再配置します。結果は {{cssxref("<transform-function>")}} データ型になります。 -

+![](transform-functions-translatex_2.png) -
-

注: translateX(tx)translate(tx, 0) または translate3d(tx, 0, 0) と等価です。

-
+> **Note:** `translateX(tx)` は `translate(tx, 0)` または `translate3d(tx, 0, 0)` と等価です。 -

構文

+## 構文 -
/* <length-percentage> values */
+```css
+/*  values */
 transform: translateX(200px);
 transform: translateX(50%);
-
+``` -

+### 値 -
-
<length-percentage>
-
変換ベクトルの横座標を表す {{cssxref("<length>")}} または {{cssxref("<percentage>")}} です。パーセント値は {{cssxref("transform-box")}} プロパティで定義される参照ボックスの幅からの相対値です。
-
+- `` + - : 変換ベクトルの横座標を表す {{cssxref("<length>")}} または {{cssxref("<percentage>")}} です。パーセント値は {{cssxref("transform-box")}} プロパティで定義される参照ボックスの幅からの相対値です。 - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + +
2 のデカルト座標ℝℙ2 の同次座標3 のデカルト座標ℝℙ3 の同次座標
-

2 では線形変換ではないので、デカルト座標の行列で表すことはできない。

-
10t010001 10t010001 100t010000100001
[1 0 0 1 t 0]
ℝ^2 のデカルト座標ℝℙ^2 の同次座標ℝ^3 のデカルト座標ℝℙ^3 の同次座標
+

+ ℝ^2 では線形変換ではないので、デカルト座標の行列で表すことはできない。 +

+
+ 1 0 t 0 1 0 0 0 1 + + 1 0 t 0 1 0 0 0 1 + + 1 0 0 t 0 1 0 0 0 0 1 0 0 0 0 1 +
[1 0 0 1 t 0]
-

形式文法

+### 形式文法 -
translateX({{cssxref("<length-percentage>")}})
-
+```css +translateX({{cssxref("<length-percentage>")}}) +``` -

+

-

HTML

+### HTML -
<div>Static</div>
-<div class="moved">Moved</div>
-<div>Static</div>
+```html +
Static
+
Moved
+
Static
+``` -

CSS

+### CSS -
div {
+```css
+div {
   width: 60px;
   height: 60px;
   background-color: skyblue;
@@ -83,38 +141,23 @@ transform: translateX(50%);
   transform: translateX(10px); /* translate(10px) と等価 */
   background-color: pink;
 }
-
+``` -

結果

+### 結果 -

{{EmbedLiveSample("Examples", 250, 250)}}

+{{EmbedLiveSample("Examples", 250, 250)}} -

仕様書

+## 仕様書 - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName("CSS3 Transforms", "#funcdef-transform-translatex", "translateX()")}}{{Spec2("CSS3 Transforms")}}初回定義
+{{Specifications}} -

ブラウザーの互換性

+## ブラウザーの互換性 -

<transform-function> データ型の互換性情報をご覧ください。

+{{Compat}} -

関連情報

+## 関連情報 - +- [`translate()`](/ja/docs/Web/CSS/transform-function/translate()) +- [`translateY()`](/ja/docs/Web/CSS/transform-function/translateY()) +- {{cssxref("transform")}} +- {{cssxref("<transform-function>")}} -- cgit v1.2.3-54-g00ecf