From d28bcff7ca880c7612940af163ec51dca3912924 Mon Sep 17 00:00:00 2001
From: kylebrentdev <79191725+kylebrentdev@users.noreply.github.com>
Date: Tue, 25 Feb 2025 23:54:52 +0800
Subject: [PATCH] docs: Clarify `rel` attribute descriptions for `noopener` and
`noreferrer`
- Updated the description of the `noopener` attribute to specify it as a value of the `rel` attribute.
- Updated the description of the `noreferrer` attribute to specify it as a value of the `rel` attribute.
---
foundations/html_css/html-foundations/links-and-images.md | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/foundations/html_css/html-foundations/links-and-images.md b/foundations/html_css/html-foundations/links-and-images.md
index fe541e2d216..0f8fa2dd6ee 100644
--- a/foundations/html_css/html-foundations/links-and-images.md
+++ b/foundations/html_css/html-foundations/links-and-images.md
@@ -62,7 +62,7 @@ While `href` specifies the destination link, `target` specifies where the linked
You may have noticed that we snuck in the `rel` attribute above. This attribute is used to describe the relation between the current page and the linked document.
-`noopener`: The `noopener` attribute ensures that a link opened in a new tab or window cannot interact with or access the original page. Without it, the new page can use JavaScript to manipulate the original page, which poses a security risk.
+`noopener`: The `noopener` value of the `rel` attribute ensures that a link opened in a new tab or window cannot interact with or access the original page. Without it, the new page can use JavaScript to manipulate the original page, which poses a security risk.
For example:
"Open Example"
@@ -72,8 +72,7 @@ target="_blank": opens the link in a new tab.
rel="noopener": prevents the new tab from accessing the original page, ensuring security.
Without `noopener`, the new tab could use JavaScript to interact with the original page, which is unsafe.
-
-`noreferrer`: The `noreferrer` attribute provides both privacy and security. It prevents the new page from knowing where the user came from (hiding the referrer) and also includes the behavior of `noopener`, preventing the new page from accessing the original page.
+`noreferrer`: The `noreferrer` value of the `rel` attribute provides both privacy and security. It prevents the new page from knowing where the user came from (hiding the referrer) and also includes the behavior of `noopener`, preventing the new page from accessing the original page.
For example:
"Visit Example"