diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/ja/web/css/offset | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/ja/web/css/offset')
-rw-r--r-- | files/ja/web/css/offset/index.html | 122 |
1 files changed, 122 insertions, 0 deletions
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 +--- +<p>{{CSSRef}}</p> + +<p><strong><code>offset</code></strong> は CSS の<a href="/ja/docs/Web/CSS/Shorthand_properties">一括指定プロパティ</a>で、要素を定義された経路に沿って動かすのに必要なすべてのプロパティを設定します。</p> + +<div class="note"> +<p><strong>注</strong>: 仕様書の早期の版では、このプロパティを <code>motion</code> と呼んでいました。</p> +</div> + +<h2 id="Constituent_properties" name="Constituent_properties">構成要素のプロパティ</h2> + +<p>このプロパティは以下の CSS プロパティの一括指定です。</p> + +<ul> + <li>{{cssxref("offset-anchor")}}</li> + <li>{{cssxref("offset-distance")}}</li> + <li>{{cssxref("offset-path")}}</li> + <li>{{cssxref("offset-position")}}</li> + <li>{{cssxref("offset-rotate")}}</li> +</ul> + +<h2 id="Syntax" name="Syntax">構文</h2> + +<pre class="brush: css notranslate">/* オフセット位置 */ +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; +</pre> + +<h2 id="Formal_definition" name="Formal_definition">公式定義</h2> + +<p>{{cssinfo}}</p> + +<h2 id="Formal_syntax" name="Formal_syntax">形式文法</h2> + +<pre class="syntaxbox notranslate">{{csssyntax}}</pre> + +<h2 id="Examples" name="Examples">例</h2> + +<h3 id="Animating_an_element_along_a_path" name="Animating_an_element_along_a_path">経路に沿って要素を動かす</h3> + +<h4 id="HTML">HTML</h4> + +<pre class="brush: html notranslate"><div id="offsetElement"></div> +</pre> + +<h4 id="CSS">CSS</h4> + +<pre class="brush: css notranslate">@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; +} +</pre> + +<h4 id="Result" name="Result">結果</h4> + +<p>{{EmbedLiveSample("Animating_an_element_along_a_path", 350, 350)}}</p> + +<h2 id="Specifications" name="Specifications">仕様書</h2> + +<table class="standard-table"> + <thead> + <tr> + <th>仕様書</th> + <th>状態</th> + <th>備考</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName('Motion Path Level 1', '#offset-shorthand', 'offset')}}</td> + <td>{{Spec2('Motion Path Level 1')}}</td> + <td>初回定義</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2> + +<div class="hidden">このページの互換性一覧表は構造化データから生成されています。データに協力していただけるのであれば、 <a class="external" href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> をチェックアウトしてプルリクエストを送信してください。</div> + +<p>{{Compat("css.properties.offset")}}</p> |