CSS marker-end

The marker-end property in CSS is used to specify the marker symbol or SVG shape that is drawn at the end of a <line>, <polyline>, <polygon>, or <path> element's stroke. This property is particularly useful for adding arrows or custom shapes to the end of lines or paths.

To use the marker-end property, you first need to define a marker using the <marker> element in SVG. This marker can then be referenced in the CSS using the url() function.

Here's an example to demonstrate how the marker-end property works:

Result:

In the above example, we first define a marker named "arrow" using the <marker> element with a custom arrow shape. We then create a <line> element that uses this marker as its end marker using the marker-end property.

You can customize the marker shape by changing the d attribute in the <path> element inside the marker definition. Additionally, you can adjust the markerWidth, markerHeight, refX, refY, and other attributes to fit your specific design needs.