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/offset/index.html | 122 +++++++++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 files/ja/web/css/offset/index.html (limited to 'files/ja/web/css/offset/index.html') diff --git a/files/ja/web/css/offset/index.html b/files/ja/web/css/offset/index.html new file mode 100644 index 0000000000..5d1bbba29d --- /dev/null +++ b/files/ja/web/css/offset/index.html @@ -0,0 +1,122 @@ +--- +title: offset +slug: Web/CSS/offset +tags: + - CSS + - CSS Motion Path + - CSS Property + - Experimental + - Reference + - 'recipe:css-shorthand-property' +translation_of: Web/CSS/offset +--- +

{{CSSRef}}

+ +

offset は CSS の一括指定プロパティで、要素を定義された経路に沿って動かすのに必要なすべてのプロパティを設定します。

+ +
+

: 仕様書の早期の版では、このプロパティを motion と呼んでいました。

+
+ +

構成要素のプロパティ

+ +

このプロパティは以下の CSS プロパティの一括指定です。

+ + + +

構文

+ +
/* オフセット位置 */
+offset: auto;
+offset: 10px 30px;
+offset: none;
+
+/* オフセット経路 */
+offset: ray(45deg closest-side);
+offset: path('M 100 100 L 300 100 L 200 300 z');
+offset: url(arc.svg);
+
+/* オフセット経路に距離と回転が加わったもの */
+offset: url(circle.svg) 100px;
+offset: url(circle.svg) 40%;
+offset: url(circle.svg) 30deg;
+offset: url(circle.svg) 50px 20deg;
+
+/* オフセットアンカーを含む */
+offset: ray(45deg closest-side) / 40px 20px;
+offset: url(arc.svg) 2cm / 0.5cm 3cm;
+offset: url(arc.svg) 30deg / 50px 100px;
+
+ +

公式定義

+ +

{{cssinfo}}

+ +

形式文法

+ +
{{csssyntax}}
+ +

+ +

経路に沿って要素を動かす

+ +

HTML

+ +
<div id="offsetElement"></div>
+
+ +

CSS

+ +
@keyframes move {
+  from {
+    offset-distance: 0%;
+  }
+
+  to {
+    offset-distance: 100%;
+  }
+}
+
+#offsetElement {
+  width: 50px;
+  height: 50px;
+  background-color: blue;
+  offset: path("M 100 100 L 300 100 L 200 300 z") auto;
+  animation: move 3s linear infinite;
+}
+
+ +

結果

+ +

{{EmbedLiveSample("Animating_an_element_along_a_path", 350, 350)}}

+ +

仕様書

+ + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('Motion Path Level 1', '#offset-shorthand', 'offset')}}{{Spec2('Motion Path Level 1')}}初回定義
+ +

ブラウザーの互換性

+ + + +

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

-- cgit v1.2.3-54-g00ecf