使用語境
屬性
x1-
定義線條起點的 X 軸座標。值型別:<length> | <percentage> | <number>;預設值:
0;可動畫:是 x2-
定義線條終點的 X 軸座標。值型別:<length> | <percentage> | <number>;預設值:
0;可動畫:是 y1-
定義線條起點的 Y 軸座標。值型別:<length> | <percentage> | <number>;預設值:
0;可動畫:是 y2-
定義線條終點的 Y 軸座標。值型別:<length> | <percentage> | <number>;預設值:
0;可動畫:是 路徑長度-
定義使用者單位的總路徑長度。值型別:<number>;預設值:無;可動畫:是
DOM 介面
此元素實現了 SVGLineElement 介面。
示例
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>
規範
| 規範 |
|---|
| Scalable Vector Graphics (SVG) 2 # LineElement |
瀏覽器相容性
載入中…
另見
- 其他 SVG 基本形狀:
<circle>、<ellipse>、<polygon>、<polyline>、<rect>