thedaviddias/Front-End-Checklist / skills/horizontal-scroll
horizontal-scroll
VerifiedUse when applies to all CSS layout rules. Check `width`, `min-width`, fixed pixel values on containers, `overflow`, `white-space`, and `word-break` properties. Use when auditing responsive design or WCAG 2.1 Level AA compliance. Test at 320px viewport width and at 400% browser zoom.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 3.5 KB |
| references/rule.md | markdown | 2.6 KB |
references/rule.md
View on GitHub# Prevent horizontal scrolling
> Web pages must not require horizontal scrolling at standard viewport widths. Horizontal overflow breaks responsive layouts and makes content inaccessible to low-vision users who zoom in.
**Priority:** medium · **Difficulty:** intermediate · **Time:** 10 min
---
Pages should not require horizontal scrolling at any standard viewport width. Horizontal overflow is especially harmful for users who rely on browser zoom or screen magnification software.
## Code Examples
### Fixed-width containers
```css
/* ❌ Problem: fixed width causes overflow on small screens */
.container {
width: 1200px;
}
/* ✅ Fix: max-width with full fluid width */
.container {
max-width: 1200px;
width: 100%;
}
```
### Images and media without max-width
```css
/* ❌ Problem: intrinsic image width overflows container */
img {
/* no width constraints */
}
/* ✅ Fix: images constrained to their container */
img, video, iframe, embed, object {
max-width: 100%;
height: auto;
}
```
### Long unbreakable strings
```css
/* ❌ Problem: long URLs or code strings overflow text containers */
.content {
/* no word-break rules */
}
/* ✅ Fix: allow breaking of long words */
.content {
overflow-wrap: break-word;
word-break: break-word; /* fallback for older browsers */
}
```
### width: 100vw causes overflow
```css
/* ❌ Problem: 100vw includes scrollbar width, causing horizontal overflow */
.hero {
width: 100vw;
}
/* ✅ Fix: use 100% relative to the parent */
.hero {
width: 100%;
}
```
### Data tables
```html
<!-- ✅ Correct: table wrapped in scrollable container -->
<div style="overflow-x: auto;" role="region" aria-label="Sales data">
<table>
<!-- wide table content -->
</table>
</div>
```
## Why It Matters
- **Screen Magnification**: ZoomText, Magnifier, and browser zoom at 200–400% effectively shrinks the viewport to 320–640px — fixed-width layouts break completely.
- **Mobile Devices**: 320px CSS width is the iPhone SE viewport — a real device, not just an edge case.
- **WCAG 2.1 AA Compliance**: SC 1.4.10 (Reflow) is a Level AA requirement — failures block certification.
- **Cognitive Load**: Horizontal scrolling disrupts reading flow and causes disorientation for all users.
## Verification
1. Inspect the rendered UI at the breakpoints and interaction states affected by the rule.
2. Confirm the computed styles match the intended fix in DevTools.
3. Test at least one mobile and one desktop viewport before shipping.
4. If the rule affects motion, contrast, or layout stability, verify those user-facing outcomes directly.Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |