このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docsコミュニティーについてもっと知り、仲間になるにはこちらから。
cy
cy 属性は中心点の Y 座標を定義します。
この属性は次の SVG 要素で使用できます。
メモ:幾何プロパティであるため、cy は<circle> および<ellipse> の CSS プロパティとしても使用できます。
In this article
例
html,body,svg { height: 100%;}html
<svg viewBox="0 0 100 300" xmlns="http://www.w3.org/2000/svg"> <radialGradient cy="25%"> <stop offset="0" stop-color="white" /> <stop offset="100%" stop-color="black" /> </radialGradient> <circle cy="50" cx="50" r="45" /> <ellipse cy="150" cx="50" rx="45" ry="25" /> <rect x="5" y="205" width="90" height="90" fill="url(#myGradient)" /></svg>circle
<circle> に対して、cy は図形の中心の Y 座標を定義します。
| 値 | <length-percentage> |
|---|---|
| 既定値 | 0 |
| アニメーション | 可 |
メモ:<circle> の中心の Y 座標はcy 幾何プロパティでも定義できます。 CSS で設定した場合、cy プロパティの値がこのcy 属性の値を上書きします。
ellipse
<ellipse> に対して、cy は図形の中心の Y 座標を定義します。
| 値 | <length-percentage> |
|---|---|
| 既定値 | 0 |
| アニメーション | 可 |
メモ:<ellipse> の中心の Y 座標はcy 幾何プロパティでも定義できます。 CSS で設定した場合、cy プロパティの値がこのcy 属性の値を上書きします。
radialGradient
<radialGradient> に対して、cy は、放射グラデーションの終端円の Y 座標を定義します。
| 値 | <length> |
|---|---|
| 既定値 | 50% |
| アニメーション | 可 |
例
html,body,svg { height: 100%;}html
<svg viewBox="0 0 34 10" xmlns="http://www.w3.org/2000/svg"> <defs> <radialGradient cy="0"> <stop offset="0%" stop-color="gold" /> <stop offset="50%" stop-color="green" /> <stop offset="100%" stop-color="white" /> </radialGradient> <radialGradient cy="50%"> <stop offset="0%" stop-color="gold" /> <stop offset="50%" stop-color="green" /> <stop offset="100%" stop-color="white" /> </radialGradient> <radialGradient cy="100%"> <stop offset="0%" stop-color="gold" /> <stop offset="50%" stop-color="green" /> <stop offset="100%" stop-color="white" /> </radialGradient> </defs> <rect x="1" y="1" width="8" height="8" fill="url(#myGradient000)" stroke="black" /> <rect x="13" y="1" width="8" height="8" fill="url(#myGradient050)" stroke="black" /> <rect x="25" y="1" width="8" height="8" fill="url(#myGradient100)" stroke="black" /></svg>仕様書
| Specification |
|---|
| Scalable Vector Graphics (SVG) 2> # RadialGradientElementCYAttribute> |