Text

  • Introduction
  • Use plain text for text: Text has many benefits over other content formats: it can be read by software, it adapts to different user environments, and text supports user customization. Whenever possible, favor text over other content formats.
  • Use CSS for styling text: Style sheets provide the greatest flexibility for styling and customizing text display. Use style sheets to define text’s visual properties—font, size, color, and so on.
  • Allow user settings to define base text size: Users should define their optimal text size setting. Allow the main text of a page to size according to the user-defined setting.
  • Size other text elements relative to the user-defined text size: Relative measurements—such as percentages and ems—size elements relative to their parent element. Use relative measurements for type variants—such as headings and links—so they size relative to the user-defined text setting.
  • Design pages that can accommodate different text sizes: Users must be able to resize text and still have a functional page. Design flexible pages so users can resize text without breaking the layout.
  • Maintain contrast between text and background: Low-contrast color combinations interfere with readability. Use complementary colors and brightness values—such as black and white or purple and yellow—to produce the highest contrast between text and background.
  • Use style sheets for setting text color: Not all color combinations work for all users. Define colors using style sheets so people who need certain color combinations—such as white on black or yellow on black—can apply a custom style sheet.
  • Do not use text color alone to convey information: Color is not universally accessible and therefore cannot be relied upon as the sole means of conveying information. Pair other methods—such as typography or text—with color to convey emphasis or information.
  • Mark up text using structural tags: Structural markup adds meaning to documents. Use structural tags—H1-H6, P, EM, STRONG, and so on—to describe the meaning and function of text elements.
  • Use structural markup appropriately: Structural integrity requires that tags be used appropriately and consistently. When marking up text using structural markup, use the tag that accurately describes the element.