Langsung ke konten
Skillpedia
Website & UI (frontend)75k Β· #2868

horizontal-scroll

Fungsinya

Skill ini memeriksa bahwa halaman muat dalam lebarnya di ponsel dan saat zoom browser tinggi. Skill ini cocok untuk developer dan desainer yang menginginkan tata letak yang berfungsi untuk semua orang.

Kapan dipakai

  • βœ“Saat pengunjung di ponsel harus menggulir ke samping untuk membaca halaman.
  • βœ“Saat tabel atau gambar lebar mendorong halaman melewati layar.
  • βœ“Saat Anda perlu memenuhi aturan aksesibilitas untuk reflow pada zoom tinggi.

Link skill

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/horizontal-scroll/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/horizontal-scroll/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œBisakah Anda memeriksa apakah halaman saya bergulir ke samping di ponsel atau saat diperbesar?”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent mencari lebar tetap, teks panjang yang tidak dapat dipatahkan, dan media yang meluap dari wadahnya. Agent menyarankan lebar yang fleksibel, max-width 100 persen untuk media, dan pembungkusan kata untuk teks panjang.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Prevent horizontal scrolling

Low-vision users who cannot read at standard zoom levels increase browser zoom to 200–400%. At these zoom levels, a 1280px-wide page becomes effectively 320px wide. If elements overflow the viewport, users must scroll both vertically and horizontally to read content β€” this is exhausting and error-prone with a screen magnifier. WCAG 2.1 SC 1.4.10 (Reflow) specifically addresses this, requiring that all content is available without two-dimensional scrolling at 400% zoom.

Quick Reference

  • Pages must not produce horizontal scrollbars at viewport widths of 320px and above β€” WCAG 2.1 SC 1.4.10 (Reflow)
  • WCAG 2.1 SC 1.4.10 requires content to reflow at 400% zoom (equivalent to 320px CSS width) without horizontal scroll
  • Common causes: fixed-width elements wider than the viewport, width: 100vw not accounting for scrollbar width, long unbreakable strings, white-space: nowrap
  • Use max-width: 100% on images and media, overflow-wrap: break-word on text containers, and fluid layout units

Check

Test the page at a 320px CSS viewport width (equivalent to 400% browser zoom on a 1280px screen). Look for horizontal scrollbars or content overflowing outside the viewport. Specifically check: (1) elements with fixed width values in px that exceed the viewport; (2) min-width values that prevent shrinking; (3) images or media without max-width: 100%; (4) white-space: nowrap on text that causes overflow; (5) width: 100vw on elements (scrollbar width causes overflow); (6) long URLs or unbreakable strings in content areas.

Fix

(1) Replace fixed width: Npx on layout containers with max-width: Npx plus width: 100%. (2) Add max-width: 100% and height: auto to all images and media. (3) Apply overflow-wrap: break-word (with fallback word-wrap: break-word) to text containers that may contain long strings. (4) Replace width: 100vw with width: 100% on full-width elements (avoid scrollbar overflow). (5) Use CSS Grid or Flexbox with flex-wrap: wrap for multi-column layouts. (6) For data tables, wrap in a scrollable container: overflow-x: auto on the table wrapper, not the page body.

Explain

WCAG 2.1 SC 1.4.10 (Reflow, Level AA) requires that content does not require two-dimensional scrolling when displayed at a width of 320 CSS pixels or a height of 256 CSS pixels. This corresponds to 400% zoom on a 1280Γ—1024 display. Exceptions are made for content that requires two-dimensional layout for usage (e.g., data tables, map interfaces, video). For all other content β€” body text, navigation, forms, images β€” horizontal scrolling is a barrier for screen magnification users who cannot see the full page width.

Code Review

Review stylesheets, component styles, and responsive states related to Prevent horizontal scrolling. Flag exact selectors, declarations, or breakpoints that violate the rule in the rendered UI.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/css/horizontal-scroll

Pertanyaan umum

Lebar apa yang diuji?

Skill menyatakan untuk menguji pada lebar 320 piksel, yang sesuai dengan zoom 400 persen pada layar desktop biasa.

Apa penyebab paling umum gulir ke samping?

Skill mencantumkan elemen lebar tetap, string panjang yang tidak dapat dipatahkan, pengaturan nowrap, dan lebar 100vw yang mengabaikan scrollbar.

Aturan aksesibilitas mana yang berlaku?

Skill mengutip kriteria keberhasilan WCAG 2.1 1.4.10, yang meminta konten melakukan reflow tanpa gulir dua arah.

Detail

Deskripsi asli dari pembuat

Use 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.

repo: thedaviddias/Front-End-Checklist

Popularitas

Bintang GitHub
75k
Peringkat
#2868
Lisensi
MIT
Diperbarui
31/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa