CSS marker Property
Description
The marker property is a shorthand CSS property designed to control the appearance of markers on list items and certain SVG elements. It specifically allows you to define the graphical symbols used for the start, middle, and end of a path or list. While primarily rooted in SVG styling, its presence in CSS highlights the convergence of document styling and vector graphics. Instead of manually positioning icons or using complex background images, this property provides a centralized way to manage the visual indicators that guide a reader's eye through sequential or hierarchical data.
This property acts as a convenient container for three more specific sub-properties: marker-start, marker-mid, and marker-end. When you apply the marker shorthand, it assigns the specified marker to all three positions simultaneously. This is particularly useful in SVG when you want a uniform look across a polyline or path, such as an arrowhead appearing at every vertex. In the context of standard HTML lists, the marker is often controlled via the list-style-type or the modern ::marker pseudo-element, but the marker property remains the technical foundation for more complex, vector-based decorations.
The power of the marker property lies in its ability to reference an external or internal <marker> element defined in SVG. This allows for high-level customization that goes far beyond simple circles or squares. For instance, by linking a marker to a custom-designed SVG shape, you can ensure that the decoration scales perfectly with the text size and maintains its orientation relative to the path it is attached to. This level of control is often more robust than using content within a pseudo-element, as it respects the geometric coordinates of the element it is marking, ensuring a more integrated and professional visual flow.
Definition
- Initial value
- none
- Applies to
- <circle>, <ellipse>, <line>, <path>, <polygon>, <polyline>, and <rect> elements in an svg
- Inherited
- yes
- Computed value
- as specified
- Animatable
- yes
- JavaScript syntax
- object.style.marker
Syntax
marker: <url> | none | inherit
Values
- <url>This is the most common value. It provides a reference to the ID of an SVG <marker> element (e.g., url(#arrowhead)).
- noneThis is the default value. It specifies that no marker should be rendered at the vertices or endpoints of the element.
- inheritThis keyword instructs the element to take the marker value from its parent container.
Example
Browser Support
The following information will show you the current browser support for the CSS marker property. Hover over a browser icon to see the version that first introduced support for this CSS property.
This property is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 29th December 2025
