October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk5 min

How to Fix Horizontal Overflow in Mobile Website Screenshots

Reproduce the screenshot’s CSS viewport, inspect the element extending beyond it, and correct its sizing or wrapping without hiding content.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To fix horizontal overflow in a mobile website screenshot, reproduce the screenshot’s CSS viewport width, identify the element extending beyond it, and correct that element’s sizing or wrapping. Check the viewport declaration first; don’t begin by hiding overflow across the entire page, which can crop content rather than make it fit.

1. Check the page’s mobile viewport setup

Confirm the document includes a viewport declaration such as:

As an Amazon Associate I earn from qualifying purchases.

<meta name="viewport" content="width=device-width, initial-scale=1">

Without a viewport hint, some mobile browsers use a fixed initial containing-block width—typically 980 CSS pixels—and scale the page down to the device. That can make a desktop-sized layout look tiny and require zooming or panning. See MDN’s viewport meta tag guide.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

2. Reproduce the screenshot’s viewport

Open your browser’s responsive design or device emulation tools and enter the viewport dimensions at which the screenshot was captured. Screenshot image dimensions may be in device pixels rather than CSS pixels, so check the device scale factor before treating image width as CSS viewport width.

#1 Best Overall
Sale
Samsung Galaxy A17 5G Smart Phone 128GB US 1 Yr Manufacturer Warranty Black | Large AMOLED, High-Res Camera, Durable Design, Super Fast Charging, Expandable Storage, Circle to Search, 2025
  • YOUR CONTENT, SUPER SMOOTH: The ultra-clear 6.7" FHD+ Super AMOLED display of Galaxy A17 5G helps bring your content to life, whether you're scrolling through recipes or video chatting with loved ones.¹
  • LIVE FAST. CHARGE FASTER: Focus more on the moment and less on your battery percentage with Galaxy A17 5G. Super Fast Charging powers up your battery so you can get back to life sooner.²
  • MEMORIES MADE PICTURE PERFECT: Capture every angle in stunning clarity, from wide family photos to close-ups of friends, with the triple-lens camera on Galaxy A17 5G.
  • NEED MORE STORAGE? WE HAVE YOU COVERED: With an improved 2TB of expandable storage, Galaxy A17 5G makes it easy to keep cherished photos, videos and important files readily accessible whenever you need them.³
  • BUILT TO LAST: With an improved IP54 rating, Galaxy A17 5G is even more durable than before.⁴ It’s built to resist splashes and dust and comes with a stronger yet slimmer Gorilla Glass Victus front and Glass Fiber Reinforced Polymer back.

Test just above and below the failing width as well. A layout may switch at a media-query breakpoint, or a component may have a minimum width that only becomes problematic in a narrower range. Browser responsive tools and CSS width media features are described in MDN’s media query guide.

3. Locate the element creating extra width

Use developer tools to inspect the rendered DOM and computed styles. Look at the box model, including content width, padding, and borders, then temporarily disable suspicious declarations to see which change removes the page’s excess width.

Rank #2
Tracfone Motorola Moto G 2025, 64GB, Saphire Blue (Locked to
  • Carrier: This phone is locked to Tracfone, which means this device can only be used on the Tracfone wireless network. Tracfone plan required, activating is easy, just 3 steps.
  • DISPLAY: Immersive viewing on a 6.7-inch super-bright 120Hz display with powerful stereo speakers and Bass Boost for cinematic entertainment.
  • CAMERA SYSTEM: Advanced 50MP Quad Pixel camera captures sharp, detailed photos and videos in any lighting condition
  • PERFORMANCE: Lightning-fast 5G connectivity paired with a powerful processor and RAM Boost for smooth multitasking.
  • BATTERY LIFE: Long-lasting 5000mAh battery with TurboPower charging technology delivers hours of power in minutes.
  • Check fixed width or min-width values larger than the available space.
  • Inspect grid and flex rows whose children cannot wrap or shrink.
  • Check margins and padding that add to a constrained width.
  • Look for images, embeds, or other media retaining an intrinsic width.
  • Find long URLs, identifiers, or other unbreakable text.
  • Inspect fixed-position controls and other UI that may extend beyond the viewport.

The specific culprit depends on the page’s actual DOM and CSS; a screenshot alone does not establish which declaration is responsible. Developer tools let you inspect and edit CSS rules and examine the box model; see Chrome DevTools: Inspect and edit CSS.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

4. Fix the cause without hiding useful content

Make media fit its container

Where appropriate for the design, let images and similar media shrink to the width of their container:

Rank #3
Sale
Samsung Galaxy A17 5G Smart Phone 128GB, US 1 Yr Manufacturer Warranty Blue | Large AMOLED, High-Res Camera, Durable Design, Super Fast Charging, Expandable Storage, Circle to Search, 2025
  • YOUR CONTENT, SUPER SMOOTH: The ultra-clear 6.7" FHD+ Super AMOLED display of Galaxy A17 5G helps bring your content to life, whether you're scrolling through recipes or video chatting with loved ones.¹
  • LIVE FAST. CHARGE FASTER: Focus more on the moment and less on your battery percentage with Galaxy A17 5G. Super Fast Charging powers up your battery so you can get back to life sooner.²
  • MEMORIES MADE PICTURE PERFECT: Capture every angle in stunning clarity, from wide family photos to close-ups of friends, with the triple-lens camera on Galaxy A17 5G.
  • NEED MORE STORAGE? WE HAVE YOU COVERED: With an improved 2TB of expandable storage, Galaxy A17 5G makes it easy to keep cherished photos, videos and important files readily accessible whenever you need them.³
  • BUILT TO LAST: With an improved IP54 rating, Galaxy A17 5G is even more durable than before.⁴ It’s built to resist splashes and dust and comes with a stronger yet slimmer Gorilla Glass Victus front and Glass Fiber Reinforced Polymer back.
img, video, iframe {
  max-width: 100%;
}

Apply this selectively if an embed or media type needs different sizing behavior. Confirm that the result preserves the intended aspect ratio and does not make the content unusably small.

Let layouts reflow when columns no longer fit

Remove unjustified fixed or minimum widths and change a multi-column layout to fewer columns or a single column when the available viewport cannot accommodate it. Choose the media-query threshold based on when the content needs to change, not on an assumed universal phone width.

Rank #4
Sale
Samsung Galaxy S26 Ultra, Unlocked Android Smartphone, 512GB, Black
  • PRIVACY DISPLAY: Automatically hide your screen from those beside you. The built-in privacy display can be preset¹ to turn on when receiving notifications, typing passwords, or using specific apps
  • TYPE IT IN. TRANSFORM IT FAST: Enhance any shot in seconds on your smartphone by using Photo Assist² with Galaxy AI.³ Add objects, restore details, or apply new styles by simply typing or tapping
  • NIGHTS, CAPTURED CLEARLY: From gigs to city lights, record and capture moments after dark with clarity using Nightography so your photos and videos stay crisp and clear on your Samsung Galaxy
  • MAKE IT. EDIT IT. SHARE IT: Turn everyday moments into something personal with creative tools built right into your mobile phone, whether it’s a special contact photo, custom wallpaper, an invitation or more⁴
  • HELP THAT KEEPS UP: Stay in the moment while Now Nudge with Galaxy AI helps you respond faster and stay organized with smart suggestions⁵ that appear exactly when you need them on your phone
@media (max-width: 40rem) {
  .content-layout {
    grid-template-columns: 1fr;
  }
}

This is only an example: adapt the selector, layout, and threshold to the component you found during inspection.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Wrap long unbroken text when appropriate

For URLs, identifiers, or other strings that have no normal break points, consider:

Best Value
Tracfone Moto g Play 2024 Prepaid Phone with a 1-Yr Plan Included
  • Carrier: This phone is locked to Tracfone, which means this device can only be used on the Tracfone wireless network. Activating is easy, just 3 steps.
  • ACTIVATION Promotion: Includes 1500 min, 1500 texts & 1500 MB Data + add more as you need it
  • CAMERA SYSTEM: 50MP Quad Pixel camera. Capture sharper, more vibrant photos day or night with 4x the light sensitivity.
  • PERFORMANCE: Blazing-fast Qualcomm performance. Get the speed you need for great entertainment with a Snapdragon 680 processor and 4GB of RAM.
  • 64GB built-in storage. Get plenty of room for photos, movies, songs, and apps. Made for US
.long-text {
  overflow-wrap: anywhere;
}

overflow-wrap: anywhere allows breaks within an otherwise unbreakable string, and those new soft-wrap opportunities count when calculating the element’s min-content size. overflow-wrap: break-word also permits breaks, but those opportunities do not count toward min-content sizing. Choose based on the desired intrinsic sizing behavior. See MDN’s overflow-wrap reference.

Keep intentional horizontal scrolling inside its component

Some content, such as a wide data table, may not be usefully reflowed. In that case, constrain the horizontal scroller to that component so it can scroll internally instead of making the whole page wider than the screen.

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
}

Don’t use hidden overflow as a blanket repair

overflow controls what happens when content does not fit an element’s padding box: it can remain visible, be clipped or hidden, or scroll. Setting overflow-x: hidden globally may conceal the symptom while cropping text, controls, or other content. Use overflow behavior when it suits the component, not as a substitute for fixing an unintended width. See MDN’s overflow reference.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

5. Verify the repair at and around the failing width

  1. Reload the page in responsive tools at the screenshot’s CSS viewport width.
  2. Check nearby narrower and wider widths to catch breakpoint gaps or newly introduced overflow.
  3. Confirm that navigation, text, buttons, images, embeds, and other content remain readable and reachable.
  4. For deliberately wide content, verify that scrolling is contained within the intended component rather than the whole page.
  5. Capture another screenshot at the same viewport conditions and compare the result.

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. A screenshot can help you see the rendered page, but diagnosing the exact overflowing CSS still requires inspecting and correcting the page itself. To capture a page with one GET request:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo documentation for API options. It removes cookie and consent banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are not billed. Its MCP server gives AI agents tools to take screenshots, get page information, and capture PDFs. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000.

Sign up free for 1,000 screenshots a month with no card.

Common troubleshooting checks

  • The whole page looks unusually small: Check for a missing or incorrect viewport declaration.
  • Overflow appears only at one width: Inspect the layout and media queries just above and below that width; a breakpoint or constrained component may be involved.
  • A long URL or identifier runs off the screen: Apply an appropriate wrapping rule to that text rather than shrinking the entire page.
  • An image or embed extends past its container: Inspect its rendered dimensions and intrinsic sizing, then constrain it appropriately.
  • Hiding overflow removes the scrollbar but content disappears: Undo the global hiding rule and fix the element’s size or layout, or scope intentional scrolling to that component.
  • The screenshot still differs from the browser preview: Confirm that the viewport is specified in CSS pixels, and compare the same responsive width and page state.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.