From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/ja/web/css/background-position-x/index.html | 106 ++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 files/ja/web/css/background-position-x/index.html (limited to 'files/ja/web/css/background-position-x/index.html') diff --git a/files/ja/web/css/background-position-x/index.html b/files/ja/web/css/background-position-x/index.html new file mode 100644 index 0000000000..b2d1d43a22 --- /dev/null +++ b/files/ja/web/css/background-position-x/index.html @@ -0,0 +1,106 @@ +--- +title: background-position-x +slug: Web/CSS/background-position-x +tags: + - CSS + - CSS プロパティ + - CSS 背景と境界 + - Experimental + - Reference +translation_of: Web/CSS/background-position-x +--- +
{{CSSRef}}
+ +

CSSbackground-position-x プロパティは、各背景画像における水平の初期位置を設定します。位置は {{cssxref("background-origin")}} によって設定された位置レイヤーに対する相対位置です。

+ +
{{EmbedInteractiveExample("pages/css/background-position-x.html")}}
+ + + +

このプロパティの値は、その後で一括指定の {{cssxref("background")}} または {{cssxref("background-position")}} プロパティが定義されると上書きされます。

+ +

構文

+ +
/* キーワード値 */
+background-position-x: left;
+background-position-x: center;
+background-position-x: right;
+
+/* <percentage> 値 */
+background-position-x: 25%;
+
+/* <length> 値 */
+background-position-x: 0px;
+background-position-x: 1cm;
+background-position-x: 8em;
+
+/* 辺からの相対値 */
+background-position-x: right 3px;
+background-position-x: left 25%;
+
+/* 複数の値 */
+background-position-x: 0px, center;
+
+/* グローバル値 */
+background-position-x: inherit;
+background-position-x: initial;
+background-position-x: unset;
+
+ +

background-position-x プロパティは、1つ以上の値をカンマで区切って指定します。

+ +

+ +
+
left
+
背景画像の左端を、背景位置レイヤーの左端に配置します。
+
center
+
背景画像を背景位置レイヤーの方向の中央に配置します。
+
right
+
背景画像の右端を、背景位置レイヤーの右端に配置します。
+
{{cssxref("<length>")}}
+
指定された背景画像の左辺の、背景位置レイヤーの左辺からのオフセットです。 (ブラウザーによってはオフセットに右辺を割り当てることもできます)。
+
{{cssxref("<percentage>")}}
+
指定された背景画像の水平位置のオフセットで、コンテナーからの相対値です。 0% の値は背景画像の左端がコンテナーの左端の位置に配置されることを意味し、 100% の値は背景画像の右端が、コンテナーの右端の位置に配置されることを意味します。したがって、 50% の値では、背景画像を水平方向の中央に配置します。
+
+ +

形式文法

+ +
{{csssyntax}}
+ +

仕様書

+ + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('CSS4 Backgrounds', '#background-position-longhands', 'background-position-x')}}{{Spec2('CSS4 Backgrounds')}}長年の実装に合わせるため、 {{cssxref("background-position")}} の個別指定サブプロパティを初回定義
+ +

{{cssinfo}}

+ +

ブラウザーの互換性

+ + + +

{{Compat("css.properties.background-position-x")}}

+ +

関連情報

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