To write link text, use short, descriptive phrases that provide context for the material that you're linking to.
Different readers experience links differently. For example, users of screen reader software often jump from one link to the next without reading the words in between. Other readers visually scan a document to find relevant links. Effective link text helps to improve accessibility and scannability.
Structure link text
To write effective link text, use one of the following forms:
-
Make the link text match the exact text of the title or heading that you're referencing.
Recommended: For more information, see Load balancing and scaling.
For information about how to capitalize such references, see Capitalization in references to titles and headings.
-
Write a description of the destination page to use as the link text, capitalized as if it's part of the sentence.
Recommended: You can use Cloud Scheduler and Cloud Functions to manage task scheduling on Compute Engine.
Sometimes you have to rework a sentence to include a phrase that makes good link text.
Write link text
Apply the following guidelines when you write link text:
-
When you write a complete sentence that refers the reader to another topic, introduce the link with the phrase For more information, see or For more information about..., see.
Recommended: For more information, see Load balancing and scaling.
Recommended: For more information about task scheduling, see Reliable task scheduling on Compute Engine with Cloud Scheduler.
For more information, see see.
-
Write unique, descriptive link text that makes sense without the surrounding text. Don't use phrases such as this document, this article, or click here.
Recommended:
For more information, see <a href="/wombats">Care and feeding of your wombat</a>.
Not recommended:
Want more? <a href="/wombats">Click here!</a>.
Also not recommended:
For more information, see <a href="/wombats">this document</a>.
-
Don't use a URL as link text. Instead, use the page title or a description of the page.
Recommended:
For more information about protocols, see <a href="http://www.w3.org/Protocols/rfc2616/rfc2616.html">HTTP/1.1 RFC</a>.
Not recommended:
See the HTTP/1.1 RFC at <a href="http://www.w3.org/Protocols/rfc2616/rfc2616.html">http://www.w3.org/Protocols/rfc2616/rfc2616.html</a>.
Exception: In some legal documents (such as some Terms of Service documents), it's okay to use URLs as link text.
- When link text is a description of the target page, use the following guidelines to help readers scan content so that they can determine if the link is relevant:
- Keep link text short where possible. Don't write lengthy link text such as a sentence or short paragraph.
- Place important words at the beginning of the link text.
- Don't use the same link text in the same document for different target pages.
-
Don't use an external link icon to indicate that the link goes to a different domain or server. If you think it's important to inform the reader that they're leaving a Google domain, mention it in the text and don't rely on an icon.
Recommended:
For more information, see OS-level virtualization.
Sometimes OK:
For more information, see the Wikipedia page about OS-level virtualization.
Not recommended:
For more information, see OS-level virtualization.
-
If a link downloads a file, write link text that indicates this action as well as the file type.
Recommended:
<a href="/readme.txt">download the README.txt file</a>
-
If the link is a
mailto
link, write link text that indicates that the link initiates the action of sending an email message.Recommended:
<a href="mailto:support@example.com">send email to Technical Support</a>
-
If the text includes an abbreviation in parentheses, include the long form and the abbreviation in the link text.
Recommended: Google Kubernetes Engine (GKE)
Not recommended: Google Kubernetes Engine (GKE)
If the text includes a command or another element usually conveyed with code font, include the description of the code element with the link text, unless doing so is awkward or redundant.
Recommended: To create an instance with a custom hostname, run the
gcloud instances create
command with the--hostname
flag.Recommended: This service supports the
GET
,HEAD
, andOPTIONS
methods.Not recommended: To create an instance with a custom hostname, run the
gcloud instances create
command with the--hostname
flag.Not recommended: This service supports the
GET
method,HEAD
method, andOPTIONS
method.
For more information about link text, see Cross-references.
Punctuation with links
If you have punctuation immediately before or after a link, put the punctuation outside of the link tags where possible.
Recommended:
For more information, see <a href="#Test">Test your code</a>.
Not recommended:
For more information, see <a href="#Test">Test your code.</a>
Style link text
If you write sitewide CSS for your website, apply standard styling to link text. This helps readers find links in your content.
- Contrast link text color and regular text color. To help readers see links, link text should be distinguishable from the rest of the text on the page.
- Underline link text, and don't underline non-link text. When readers scan a page, a horizontal line cuts through the vertical line of scanning and helps readers find links.
- Make visited links change color. Use color-blind-friendly color changes to help readers differentiate links that they've followed against links that they haven't followed. This helps readers navigate your site effectively without revisiting content that they've already read.