<line>
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015年7月.
<line> は SVG の要素で、 SVG の基本図形であり、2 つの点をつなぐ直線を作成するために使用します。
例
html
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
<line x1="0" y1="80" x2="100" y2="20" stroke="black" />
<!-- If you do not specify the stroke
color the line will not be visible -->
</svg>
属性
x1-
線の始点の X 座標を定義します。 値の型: <length> | <percentage> | <number>; 既定値:
0; アニメーション: 可 x2-
線の終点の X 座標を定義します。 値の型: <length> | <percentage> | <number>; 既定値:
0; アニメーション: 可 y1-
線の始点の Y 座標を定義します。 Value type: <length> | <percentage> | <number>; 既定値:
0; アニメーション: 可 y2-
線の終点の Y 座標を定義します。 Value type: <length> | <percentage> | <number>; 既定値:
0; アニメーション: 可 pathLength-
パス全体の長さをユーザーの単位で定義します。 Value type: <number>; 既定値: none; アニメーション: 可
使用上のメモ
仕様書
| Specification |
|---|
| Scalable Vector Graphics (SVG) 2> # LineElement> |
ブラウザーの互換性
Loading…
関連情報
- その他の SVG 基本図形:
<circle>,<ellipse>,<polygon>,<polyline>,<rect>