-
Notifications
You must be signed in to change notification settings - Fork 8k
/
index.md
66 lines (46 loc) · 1.46 KB
/
index.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
---
title: <line>
slug: Web/SVG/Element/line
---
{{SVGRef}}
L'élément `line` est un élément de la catégorie des formes simples SVG, utilisé pour créer une ligne connectant deux points.
## Contexte d'utilisation
{{svginfo}}
## Exemple
```css hidden
html,
body,
svg {
height: 100%;
}
```
```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" />
<!-- Si on n'indique pas stroke, la ligne de couleur
ne sera pas visible -->
</svg>
```
{{EmbedLiveSample('Exemple', 100, 100)}}
## Attributs
### Attributs globaux
- [Attributs conditionnels](/fr/docs/Web/SVG/Attribute#Attributs_de_traitement_conditionnel) ;
- [Attributs centraux](/fr/docs/Web/SVG/Attribute#Attributs_de_base) ;
- [Attributs d'événements graphiques](/fr/docs/Web/SVG/Attribute#Attributs_d'.C3.A9v.C3.A9nement_graphique) ;
- [Attributs de présentation](/fr/docs/Web/SVG/Attribute#Attributs_de_pr.C3.A9sentation) ;
- {{ SVGAttr("class") }} ;
- {{ SVGAttr("style") }} ;
- {{ SVGAttr("externalResourcesRequired") }} ;
- {{ SVGAttr("transform") }}.
### Attributs spécifiques
- {{ SVGAttr("x1") }}
- {{ SVGAttr("x2") }}
- {{ SVGAttr("y1") }}
- {{ SVGAttr("y2") }}
## Interface DOM
Cet élément implémente l'interface [`SVGLineElement`](/fr/DOM/SVGLineElement).
## Compatibilité des navigateurs
{{Compat}}
## Voir aussi
- {{ SVGElement("polygon") }} ;
- {{ SVGElement("path") }}.