Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. SVGMarkerElement
  4. markerWidth

SVGMarkerElement: markerWidth property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

ThemarkerWidth read-only property of theSVGMarkerElement interface returns anSVGAnimatedLength object containing the width of the<marker> viewport as defined by themarkerWidth attribute.

Value

AnSVGAnimatedLength object. ThebaseVal property of this object returns anSVGLength, the value of which returns thewidth.

Examples

ThemarkerWidth property returns anSVGAnimatedLength which contains anSVGLength with the value of themarkerWidth attribute.

html
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">  <defs>    <marker           viewBox="0 0 10 10"      refX="5"      refY="5"      markerWidth="6"      markerHeight="6"      orient="auto-start-reverse">      <path d="M 0 0 L 10 5 L 0 10 z" />    </marker>  </defs></svg>
js
let marker = document.getElementById("arrow");console.log(marker.markerWidth.baseVal.value); // 6

Specifications

Specification
Scalable Vector Graphics (SVG) 2
# __svg__SVGMarkerElement__markerWidth

Browser compatibility

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp