--- title: offset-rotate slug: Web/CSS/offset-rotate tags: - CSS - CSS Motion Path - CSS Property - CSS プロパティ - CSS モーションパス - Experimental - Reference - offset-rotate - 'recipe:css-property' translation_of: Web/CSS/offset-rotate --- <div>{{CSSRef}}</div> <p><strong><code>offset-rotate</code></strong> は CSS のプロパティで、要素が {{cssxref("offset-path")}} に沿って配置された場合の向き/方向を定義します。</p> <div>{{EmbedInteractiveExample("pages/css/offset-rotate.html")}}</div> <div class="blockIndicator note"> <p><strong>注</strong>: 初期のころの仕様書では、このプロパティを <code>motion-rotation</code> と呼んでいました。</p> </div> <h2 id="Syntax" name="Syntax">構文</h2> <pre class="brush: css notranslate">/* パスの方向に従い、任意で角度を追加 */ offset-rotate: auto; offset-rotate: auto 45deg; /* パスの方向に従うが、 auto とは逆の方向を向く */ offset-rotate: reverse; /* パスの位置に関係なく、決められた回転を維持する */ offset-rotate: 90deg; offset-rotate: .5turn;</pre> <dl> <dt><code><dfn>auto</dfn></code></dt> <dd> <p>要素は正方向の X 軸から見た {{cssxref("offset-path")}} 方向の角度で回転します。これが既定値です。</p> </dd> <dt><code>{{cssxref("<angle>")}}</code></dt> <dd> <p>要素は指定された回転角によって、時計方向に固定値で回転変換されます。</p> </dd> <dt><code><dfn>auto <angle></dfn></code></dt> <dd> <p><code>auto</code> に {{cssxref("<angle>")}} が続いた場合、<span class="production" id="ref-for-angle-value①③" title="Expands to: turn | rad | grad | deg">その角度</span>が<code>auto</code>の計算値に加算されます。</p> </dd> <dt><code><dfn>reverse</dfn></code></dt> <dd> <p>要素は <code>auto</code> と同様に回転しますが、反対方向を向きます。 <code>auto 180deg</code> の値を指定したのと同等です。</p> </dd> <dd></dd> </dl> <h3 id="Formal_syntax" name="Formal_syntax">形式文法</h3> {{csssyntax}} <h2 id="Examples" name="Examples">例</h2> <h3 id="HTML" name="HTML">HTML</h3> <pre class="brush: html notranslate"><div></div> <div></div> <div></div></pre> <h3 id="CSS" name="CSS">CSS</h3> <pre class="brush: css notranslate">div { width: 40px; height: 40px; background: #2BC4A2; margin: 20px; clip-path: polygon(0% 0%, 70% 0%, 100% 50%, 70% 100%, 0% 100%, 30% 50%); animation: move 5000ms infinite alternate ease-in-out; offset-path: path('M20,20 C20,50 180,-10 180,20'); } div:nth-child(1) { offset-rotate: auto; } div:nth-child(2) { offset-rotate: auto 90deg; } div:nth-child(3) { offset-rotate: 30deg; } @keyframes move { 100% { offset-distance: 100%; } }</pre> <h3 id="Result" name="Result">結果</h3> <p>{{EmbedLiveSample('Examples', '100%', '200')}}</p> <h2 id="Specifications" name="Specifications">仕様書</h2> <table class="standard-table"> <thead> <tr> <th scope="col">仕様書</th> <th scope="col">状態</th> <th scope="col">備考</th> </tr> </thead> <tbody> <tr> <td>{{SpecName('Motion Path Level 1', '#offset-rotate-property', 'offset-rotate')}}</td> <td>{{Spec2('Motion Path Level 1')}}</td> <td>初回定義</td> </tr> </tbody> </table> <p>{{cssinfo}}</p> <h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2> <p>{{Compat("css.properties.offset-rotate")}}</p>