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

`link-parameters` CSS property

· 52CE 我爱测

The **`link-parameters`** CSS property sets values of external resources, such as SVGs, whose attributes have been set with the env CSS function

The link-parameters CSS property sets values of external resources, such as SVGs, whose attributes have been set with the env CSS function

Syntax

/* single value */
link-parameters: param(--color, red);

/* multiple values */
link-parameters:
  param(--color1, red),
  param(--color2, blue),
  param(--color3, green);

Values

  • none

    • : No link parameters are specified.
  • param

    • : A list of one or more link parameters.

Formal definition

Example

Updating the colors of an external SVG file

In this example the original SVG, on the left, is a square with stroke attribute set with env(--color1, chartreuse) and fill attribute set with env(--color2, darkgreen). The link-parameters property is used to update both of these attributes on the updated square, on the right, with multiple param CSS functions.

<div class="squares">
  <img
    class="original"
    src="square.svg"
    alt="A square with a chartreuse border and a dark green fill." />
  <img
    class="updated"
    src="square.svg"
    alt="A square with a red border and a tomato fill." />
</div>
.squares {
  height: 200px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}
img {
  height: 100%;
}
.updated {
  link-parameters:
    param(--color1, red),
    param(--color2, tomato);
}

updating_the_colors_of_an_external_SVG_file

Specifications

Browser compatibility

See also

  • param
  • env

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

资料来源与适用范围

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

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

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