大网数据广告活动
Web 标准与前端开发

`marker-start` CSS property

· 52CE 我爱测

The **`marker-start`** CSS property points to a marker that will be drawn on the first vertex of the element's path; that is, at its starting vertex. The marker must have been defined using an SVG marker element, and can only be referenced with a url_value value. The value of the

The marker-start CSS property points to a marker that will be drawn on the first vertex of the element's path; that is, at its starting vertex. The marker must have been defined using an SVG marker element, and can only be referenced with a url_value value. The value of the CSS property overrides any values of the marker-start attribute in the SVG.

For many marker-supporting shapes, the first and last vertices are in the same place: for example, the top left corner of a rect. In such shapes, if both the first and last markers are defined, two markers will be drawn at that point, though they may not point in the same direction.

[!NOTE] The marker-start property will only have an effect for elements that can use SVG markers. See marker-start for a list.

Syntax

marker-start: none;
marker-start: url("markers.svg#arrow");

/* Global values */
marker-start: inherit;
marker-start: initial;
marker-start: revert;
marker-start: revert-layer;
marker-start: unset;

Values

  • none

    • : This means no marker will be drawn at the first vertex of the element's path.
  • <marker-ref>

    • : A url_value that refers to a marker defined by an SVG marker element, to be drawn at the first vertex of the element's path. If the URL reference is invalid, no marker will be drawn at the path's first vertex.

Formal definition

Formal syntax

Example

html,
body,
svg {
  height: 100%;
}
<svg viewBox="0 0 120 120" xmlns="http://www.w3.org/2000/svg">
  <defs>
    <marker
      id="triangle"
      viewBox="0 0 10 10"
      markerWidth="10"
      markerHeight="10"
      refX="1"
      refY="5"
      markerUnits="strokeWidth"
      orient="auto">
      <path d="M 0 0 L 10 5 L 0 10 z" fill="red" />
    </marker>
  </defs>
  <polyline
    id="test"
    fill="none"
    stroke="black"
    points="20,100 40,60 70,80 100,20" />
</svg>
polyline#test {
  marker-start: url("#triangle");
}

Example

Specifications

Browser compatibility

See also

  • marker-mid
  • marker-end
  • marker
  • SVG marker-start attribute

来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
MDN Web Docs / Mozilla 贡献者
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 2.5

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。