Skip to primary navigation Skip to main content
US flag signifying that this is a United States Federal Government website An official website of the United States Government USDA United State Department of Agriculture Farm Production and Conservation

Text Properties

Properly identifying the language for your website content ensures Assistive Technology (AT) correctly interacts with your site. AT has great support for a wide variety of foreign languages, but will need to know when the language differs from the page's default.

Testing

  1. Open the inspector panel.
  2. Locate the main html tag.
    • If the lang attribute isn’t set to the correct language, this is a failure.
  3. Identify any content that differs from the default language, make sure the content has its own lang attribute set with that language.
    • Any alternate language content not set constitutes a failure.

Examples

Failure

<p>Sus ojos son verdes.</p>

Fails: This text is Spanish and lacks a lang attribute to differentiate it from the page’s default language.

Passes

<p lang="es">Sus ojos son verdes.</p>

Passes: This text passes because the lang="es" attribute identifies its content as Spanish while the page’s default is English.

Return to top