-
Notifications
You must be signed in to change notification settings - Fork 22.4k
/
index.md
91 lines (72 loc) · 2.14 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
---
title: marker-mid
slug: Web/SVG/Attribute/marker-mid
page-type: svg-attribute
browser-compat: svg.global_attributes.marker-mid
---
{{SVGRef}}
The **`marker-mid`** attribute defines the arrowhead or polymarker that will be drawn at all interior vertices of the given [shape](/en-US/docs/Web/SVG/Element#shape_elements).
The marker is rendered on every vertex other than the first and last vertices of the [path data](/en-US/docs/Web/SVG/Attribute/d#path_commands).
> [!NOTE]
> As a presentation attribute, `marker-mid` can be used as a CSS property. See {{cssxref('marker-mid')}} 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="circle" markerWidth="8" markerHeight="8" refX="4" refY="4">
<circle cx="4" cy="4" r="4" stroke="none" fill="#f00" />
</marker>
</defs>
<polyline
fill="none"
stroke="black"
points="20,100 40,60 70,80 100,20"
marker-mid="url(#circle)" />
</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 given vertices.
- `<marker-ref>`
- : This value is a reference to a {{SVGElement("marker")}} element, which will be drawn at the given vertices. 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-end")}}
- CSS {{cssxref('marker-mid')}} property