Replies: 1 comment
-
@criminaljusticehub/content-design-team |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
To open external links in a new tab without requiring users to leave the page they're on, you can modify the HTML code of your content by adding the
target="_blank"
attribute to the anchor (<a>
) tags. This attribute instructs the browser to open the linked page in a new tab or window, depending on the user's browser settings.Here's how to do it:
Example:
Explanation:
href
: Specifies the URL of the page you want to link to.target="_blank"
: Ensures the link opens in a new tab or window.Best Practice:
For accessibility and security reasons, it's a good idea to also include the
rel="noopener noreferrer"
attribute when usingtarget="_blank"
. This prevents the new page from accessing the original page’swindow
object, which can protect against security vulnerabilities.Example with Best Practice:
Please see the example I have added at the bottom of the content on this page on the ALPHA site.
You can edit the HTML code for a piece of content by clicking on Source within the edit toolbar. (See below)
Beta Was this translation helpful? Give feedback.
All reactions