Join MDN and developers like you at Mozilla's View Source conference, 12-14 September in Berlin, Germany. Learn more at https://viewsourceconf.org

この記事はまだボランティアによって 日本語 に翻訳されていません。ぜひ MDN に参加して翻訳を手伝ってください!

The marker element defines the graphics that is to be used for drawing arrowheads or polymarkers on a given <path>, <line>, <polyline> or <polygon> element.

Usage context

CategoriesContainer element
Permitted contentAny number of the following elements, in any order:
Animation elements
Descriptive elements
Shape elements
Structural elements
Gradient elements
<a>, <altGlyphDef>, <clipPath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignObject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view>

Example

Source code Output result
<?xml version="1.0"?>
<svg width="120" height="120" viewBox="0 0 120 120"
     xmlns="http://www.w3.org/2000/svg" version="1.1"
     xmlns:xlink="http://www.w3.org/1999/xlink">

    <defs>
        <marker id="Triangle"
                viewBox="0 0 10 10" 
                refX="1" refY="5"
                markerWidth="6" 
                markerHeight="6"
                orient="auto">
            <path d="M 0 0 L 10 5 L 0 10 z" />
	    </marker>
    </defs>

    <polyline points="10,90 50,80 90,20"
              fill="none" stroke="black" 
              stroke-width="2"
              marker-end="url(#Triangle)" />
</svg>

» marker.svg

Attributes

Global attributes

Specific attributes

DOM Interface

This element implements the SVGMarkerElement interface.

Specifications

Specification Status Comment
Scalable Vector Graphics (SVG) 2
The definition of '<marker>' in that specification.
Working Draft  
Scalable Vector Graphics (SVG) 1.1 (Second Edition)
The definition of '<marker>' in that specification.
Recommendation Initial definition

Browser compatibility

Feature Chrome Firefox (Gecko) IE Opera Safari
Basic support 1.0 1.5 (1.8) 9.0 9.0 3.0.4
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support 3.0 1.0 (1.8) Not supported (Yes) 3.0.4

The chart is based on these sources.

ドキュメントのタグと貢献者

 このページの貢献者: Sebastianz, kscarfone, xdhmoore, Jeremie, Manuel_Strehl
 最終更新者: Sebastianz,