VOOZH about

URL: https://www.geeksforgeeks.org/html/svg-markerwidth-attribute/

⇱ SVG markerWidth Attribute - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

SVG markerWidth Attribute

Last Updated : 31 Mar, 2022

The markerWidth attribute indicates the width of the viewport within which the <marker> is to be adjusted when it is displayed according to the preserveAspectRatio and viewBox attributes. Only <marker> element is using this attribute.

Syntax:

markerWidth = "length-percentage" | "number"

Attribute values: The markerWidth attribute accepts values mentioned above and described below. 

  • length-percentage: It indicates either an relative or an absolute width of the marker.
  • number: It indicates the width of the marker in the units defined by the markerUnits attribute.

Note: The default value of markerWidth attribute is 3.

Example 1: Below are the examples that illustrates the use of markerWidth attribute.

Output:

👁 Image

Example 2:

Output:

👁 Image
Comment