Movatterモバイル変換


[0]ホーム

URL:


  1. 開発者向けのウェブ技術
  2. SVG
  3. リファレンス
  4. 属性
  5. r

このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docsコミュニティーについてもっと知り、仲間になるにはこちらから。

View in EnglishAlways switch to English

r

r 属性は円の半径を定義します。

この属性は次の SVG 要素で使用できます。

パーセント値は、現在の SVG ビューポートの正規化された対角線に対する割合です。これは、<width>2+<height>22 で計算されたものです。

html,body,svg {  height: 100%;}
html
<svg viewBox="0 0 300 200" xmlns="http://www.w3.org/2000/svg">  <radialGradient r="0">    <stop offset="0" stop-color="white" />    <stop offset="100%" stop-color="black" />  </radialGradient>  <radialGradient r="50%">    <stop offset="0" stop-color="white" />    <stop offset="100%" stop-color="black" />  </radialGradient>  <radialGradient r="100%">    <stop offset="0" stop-color="white" />    <stop offset="100%" stop-color="black" />  </radialGradient>  <circle cx="50" cy="50" r="0" />  <circle cx="150" cy="50" r="25" />  <circle cx="250" cy="50" r="50" />  <rect x="20" y="120" width="60" height="60" fill="url(#myGradient000)" />  <rect x="120" y="120" width="60" height="60" fill="url(#myGradient050)" />  <rect x="220" y="120" width="60" height="60" fill="url(#myGradient100)" /></svg>

circle

<circle> に関しては、r は、円の半径を定めており、したがって、その円の大きさを定めています。ゼロ以下の値を用いると、その円はまったく描画されません。

<length> |<percentage>
既定値0
アニメーション

メモ:<circle> の半径の大きさは、r 幾何プロパティで定義することもできます。

radialGradient

<radialGradient> において、r は、放射グラデーションの末端の円の半径を定めます。

グラデーションは、100% の色経由点 (stop) が、この末端の円の外周に対応するように描画されます。ゼロ以下の値を用いると、グラデーションの最後の<stop> の色と不透明度を使った単一の色で、当該領域を塗りつぶすことになります。

<length>
既定値50%
アニメーション

仕様書

Specification
Scalable Vector Graphics (SVG) 2
# RadialGradientElementRAttribute

ブラウザーの互換性

svg.elements.circle.r

svg.elements.radialGradient.r

関連情報

  • CSS のr プロパティ

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp