Handling Wide Examples on a Narrow Page

A wide table or code example can remain readable without forcing the entire page past the viewport.

Source
Anbloq
Language
English
Created
Updated
Chapters
2
Reading time
1 min
In this article2 chapters
  1. Trace a code sample
  2. Check the rest of the page

Trace a code sample

Indentation can carry meaning in source. For a long line, a separate overflow region may preserve the exact example. Identify it clearly and test keyboard access if scrolling is needed. See logical blocks.

Check the rest of the page

Verify nearby text wraps naturally and readers can get past the block. A complicated table may also benefit from a short summary or simpler alternate representation. Responsive reflow applies to the full view.[1][2]

References

  1. W3C, Web Content Accessibility Guidelines 2.2 ↩
  2. W3C Web Accessibility Initiative, Forms Tutorial ↩