--- title: line slug: Web/SVG/Element/line tags: - Element - Reference - SVG - SVG Graphics - 要素 translation_of: Web/SVG/Element/line ---
<line> 要素は SVG の基本図形であり、2つの点をつなぐ直線を作成するために使用します。
html,body,svg { height:100% }
<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>
{{EmbedLiveSample('Example', 100, 100)}}
0; アニメーション: 可0; アニメーション: 可0; アニメーション: 可0; アニメーション: 可aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role{{svginfo}}
| 仕様書 | 状態 | 備考 |
|---|---|---|
| {{SpecName('SVG2', 'shapes.html#LineElement', '<line>')}} | {{Spec2('SVG2')}} | x1、y1、x2、y2 属性に{{cssxref("<length>")}}、{{cssxref("<percentage>")}}、{{cssxref("<number>")}}を指定できるように変更 |
| {{SpecName('SVG1.1', 'shapes.html#LineElement', '<line>')}} | {{Spec2('SVG1.1')}} | 初回定義 |
{{Compat("svg.elements.line")}}