H33: Supplementing Link Text With The Title Attribute

Có thể bạn quan tâm

Skip to content
  • About this Technique
  • Description
  • Examples
  • Related Resources
  • Related Techniques
  • Tests
Technique H33:Supplementing link text with the title attribute

About this Technique

This technique relates to:

  • 2.4.4: Link Purpose (In Context) (Sufficient when used for providing a supplemental description of the purpose of a link)
  • 2.4.9: Link Purpose (Link Only) (Advisory)

This technique applies to HTML.

Description

The objective of this technique is to demonstrate how to use a title attribute on an anchor element to provide additional text describing a link. The title attribute is used to provide additional information to help clarify or further describe the purpose of a link. If the supplementary information provided through the title attribute is something the user should know before following the link, such as a warning, then it should be provided in the link text rather than in the title attribute.

Because of the extensive user agent limitations in supporting access to the title attribute, authors should use caution in applying this technique. For this reason, it is preferred that the author use technique C7: Using CSS to hide a portion of the link text or H30: Providing link text that describes the purpose of a link for anchor elements.

Examples

Example 1: Clarifying the purpose of a link

<a href="https://example.com/world/africa/kenya.elephants.ap/index.html" title="Read more about failed elephant evacuation"> Evacuation Crumbles Under Jumbo Load </a>

Related Resources

No endorsement implied.

  • HTML - the title attribute

Related Techniques

  • C7: Using CSS to hide a portion of the link text
  • H30: Providing link text that describes the purpose of a link for anchor elements

Tests

Procedure

Examine the source code for anchor elements.

  1. For each anchor element that has a title attribute, check that the title attribute together with the link text describes the purpose of the link.

Expected Results

  • Check #1 is true.
Back to Top

Please share your ideas, suggestions, or comments via email to the publicly-archived list [email protected] or via GitHub

Email Fork & Edit on GitHub New GitHub Issue

Từ khóa » H 33