-
Notifications
You must be signed in to change notification settings - Fork 22.4k
/
index.md
99 lines (80 loc) · 2.58 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
---
title: marker-end
slug: Web/SVG/Attribute/marker-end
page-type: svg-attribute
browser-compat: svg.global_attributes.marker-end
---
{{SVGRef}}
The **`marker-end`** attribute defines the arrowhead or polymarker that will be drawn at the final vertex of the given [shape](/en-US/docs/Web/SVG/Element#shape_elements).
For all shape elements, except {{SVGElement("polyline")}} and {{SVGElement("path")}}, the last vertex is the same as the first vertex. In this case, if the value of {{SVGAttr("marker-start")}} and `marker-end` are both not `none`, then two markers will be rendered on that final vertex. For `<path>` elements, for each closed subpath, the last vertex is the same as the first vertex. `marker-end` is only rendered on the final vertex of the [path data](/en-US/docs/Web/SVG/Attribute/d#path_commands).
> [!NOTE]
> As a presentation attribute, `marker-end` can be used as a CSS property. See {{cssxref('marker-end')}} for more.
You can use this attribute with the following SVG elements:
- {{SVGElement("circle")}}
- {{SVGElement("ellipse")}}
- {{SVGElement("line")}}
- {{SVGElement("path")}}
- {{SVGElement("polygon")}}
- {{SVGElement("polyline")}}
- {{SVGElement("rect")}}
## Example
```css hidden
html,
body,
svg {
height: 100%;
}
```
```html
<svg viewBox="0 0 120 120" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker
id="triangle"
viewBox="0 0 10 10"
refX="1"
refY="5"
markerUnits="strokeWidth"
markerWidth="10"
markerHeight="10"
orient="auto">
<path d="M 0 0 L 10 5 L 0 10 z" fill="#f00" />
</marker>
</defs>
<polyline
fill="none"
stroke="black"
points="20,100 40,60 70,80 100,20"
marker-end="url(#triangle)" />
</svg>
```
{{EmbedLiveSample("Example", "200", "200")}}
## Usage notes
<table class="properties">
<tbody>
<tr>
<th scope="row">Value</th>
<td><code>none</code> | <code><marker-ref></code></td>
</tr>
<tr>
<th scope="row">Default value</th>
<td><code>none</code></td>
</tr>
<tr>
<th scope="row">Animatable</th>
<td>discrete</td>
</tr>
</tbody>
</table>
- `none`
- : Indicates that no marker symbol shall be drawn at the final vertex.
- `<marker-ref>`
- : This value is a reference to a {{SVGElement("marker")}} element, which will be drawn at the final vertex. If the reference is not valid, then no marker will be drawn.
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- {{SVGElement("marker")}}
- {{SVGAttr("marker-start")}}
- {{SVGAttr("marker-mid")}}
- CSS {{cssxref('marker-end')}} property