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

rel

· 52CE 我爱测

The **`rel`** attribute defines a unique space-separated list of values that define a relationship between a linked resource and the current document. These keywords carry a semantic meaning. You can use this attribute with the following SVG elements:

The rel attribute defines a unique space-separated list of values that define a relationship between a linked resource and the current document. These keywords carry a semantic meaning. You can use this attribute with the following SVG elements:

  • a

Example

<svg viewBox="0 0 150 20" xmlns="http://www.w3.org/2000/svg">
  <a href="https://example.com" rel="external noopener">
    <text x="5" y="15">Website</text>
  </a>
</svg>

Example

Usage notes

<table class="properties"> <tbody> <tr> <th scope="row">Value</th> <td>Space-separated list of keywords</td> </tr> <tr> <th scope="row">Default value</th> <td>None</td> </tr> <tr> <th scope="row">Animatable</th> <td>No</td> </tr> </tbody> </table>

The rel attribute takes a space-separated list of keywords as a value. Common keywords include:

  • alternate
    • : Provides an alternate representation of the linked document.
  • author
    • : Provides a link to the author of the document.
  • bookmark
    • : Provides a permanent URL to use for bookmarking the section the linking element is most closely associated with.
  • external
    • : Indicates that the referenced document is not part of the current site.
  • help
    • : Links to a context-sensitive help document.
  • license
    • : Links to the copyright license covering the current document.
  • nofollow
    • : Links to an unendorsed document, or tells the search engine not to follow this link.
  • noopener
    • : Opens the link without providing the target context access to the document (window.opener).
  • noreferrer
    • : Opens the link without providing the target the Referer header.
  • opener
    • : The opposite of noopener. Opens the link providing the target context access to the document (window.opener).
  • privacy-policy
    • : Indicates that the referenced document is the Privacy policy of the current site.
  • search
    • : Indicates that the referenced document includes an interface specifically for searching the document.
  • tag
    • : Gives a tag (identifier) that applies to the current document.
  • terms-of-service
    • : Indicates that the referenced document contains agreements between the current document's provider and the potential users.
  • prev
    • : Indicates that the document is a part of a series, and the linked reference links to the previous document.
  • next
    • : The opposite of prev. Indicates that the document is a part of a series, and the linked reference links to the next document.

Specifications

Browser compatibility

See also

  • href
  • a
  • SVGAElement.rel

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

资料来源与适用范围

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

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

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