Fix it so long strings don't cause the page to get wider on mobile
Author: RayBBCreated Sep 20, 2026Updated Sep 24, 2026
LabelsType: BugPriority: 3Good First IssueAffects: UIAffects: Mobile/ResponsiveNeeds: ResponseLead: @lokeshModule: CSS
Problem
https://openlibrary.org/help/faq/editing
Probably one line of CSS we need to update.
Reproducing the bug
- Open https://openlibrary.org/help/faq/editing on a phone, or at a 375px-wide viewport in devtools
- Scroll down to the list of example work URLs
- Expected behavior: long strings wrap inside the content column, and the page doesn't scroll sideways.
- Actual behavior:
Moon_is_Down_Of_Mice_and_Men_Pearl_Red_Pony_Tortilla…runs off the edge, which makes the whole page (header included) wider than the viewport.
Context
- Browser (Chrome, Safari, Firefox, etc): any (mobile)
- OS (Windows, Mac, etc):
- Logged in (Y/N):
- Environment (prod, dev, local): prod
Breakdown
Implementation Details (for maintainers)Cause. Two things combine:
- The only wrap rule for wiki pages is
div#contentBody p a { word-wrap: break-word; }, so it only covers links inside paragraphs. Plain text, list items, headings, etc. don't wrap. - On this page, the URL
https://openlibrary.org/works/OL23185W/The_Short_Novels_of_John_Steinbeck_(Cannery_Row_…contains parentheses, which break the markdown link. The link ends partway through, and the rest renders as unlinked plain text. Rule 1 doesn't cover plain text, so it overflows.
Fix. Make wrapping apply to the whole content container instead of just p a:
div.contentBody,
div#contentBody {
overflow-wrap: break-word;
}Then remove the now-redundant p a rule. break-word only breaks a string that can't fit on its own line, so normal text on other pages is unaffected.
Requirements Checklist
- Replace the
div#contentBody p a/div.contentBody p arule instatic/css/layout/index.csswithoverflow-wrap: break-wordondiv#contentBody, div.contentBody - Verify at a 375px viewport that
/help/faq/editingno longer scrolls horizontally (include before/after screenshots in the PR) - Spot-check a few other pages that use the same template (
/about,/help, another/help/faq/*page) for regressions - (Maintainer, separate from the PR) Fix the malformed links on
/help/faq/editingitself (theOL23185WandOL17592217Wexamples) by editing the page source via?m=edit
Related files
static/css/layout/index.css(the#contentBodyrules, ~L55-66)openlibrary/templates/type/page/view.html(wraps wiki page bodies in#contentBody)
Stakeholders
- @lokesh
Instructions for Contributors
- Please run these commands to ensure your repository is up to date before creating a new branch to work on this issue and each time after pushing code to Github, because the pre-commit bot may add commits to your PRs upstream.
Source: internetarchive/openlibrary