<polygon>
Baseline Widely available *
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
* Some parts of this feature may have varying levels of support.
<polygon>
は SVG の要素で、接続された一連の直線の区間で構成される閉じた図形を定義します。最後の点は最初の点と結ばれます。
開いた図形については <polyline>
要素をご覧ください。
例
html
<svg viewBox="0 0 200 100" xmlns="http://www.w3.org/2000/svg">
<!-- 既定で塗りつぶす多角形の例 -->
<polygon points="0,100 50,25 50,75 100,0" />
<!-- 同じ多角形で線を持ち塗りつぶされない例 -->
<polygon points="100,100 150,25 150,75 200,0" fill="none" stroke="black" />
</svg>
属性
points
-
この属性は多角形を描くのに必要な点 (絶対座標の
x,y
の組) のリストを定義します。 値の型: <number>+ ; 既定値:""
; アニメーション: 可 pathLength
-
This attribute lets specify the total length for the path, in user units. 値の型: <number> ; 既定値: none; アニメーション: 可
使用コンテキスト
仕様書
Specification |
---|
Scalable Vector Graphics (SVG) 2 # PolygonElement |
ブラウザーの互換性
関連情報
-
SVG プレゼンテーション属性、例えば
fill
やstroke
-
他の SVG 基本図形: