Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk4 min

HTMLCSStoImage Screenshot Dimensions Wrong? Fix the Viewport Settings

Diagnose HTMLCSStoImage screenshot size problems by separating CSS viewport dimensions from output pixel scale, full-page capture, and cropping.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If an HTMLCSStoImage capture has the wrong size, first separate the page’s CSS layout dimensions from the output file’s pixel dimensions. Set viewport_width and viewport_height together to control the browser viewport; check device_scale if the image file has more pixels than expected. For an image that is too tall or shows the wrong region, inspect full-page capture and cropping settings.

Set both viewport dimensions for the intended layout

The viewport is the browser’s visible area, measured in CSS pixels. Its width determines which responsive CSS breakpoints apply, while its height sets the visible vertical area for a normal viewport capture. HTML/CSS to Image documents a default viewport of 1920 × 1080 and a maximum viewport width of 6000 pixels; the maximum height is not stated in the reviewed documentation. See the Viewport Params documentation.

As an Amazon Associate I earn from qualifying purchases.

Supply both dimensions in the same request. For example, this JSON describes a desktop layout viewport measuring 1200 × 630 CSS pixels:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
{
  "url": "https://example.com",
  "viewport_width": 1200,
  "viewport_height": 630
}

If only one dimension is supplied, that is not the documented method for setting the viewport. Add the missing dimension and request the capture again.

#1 Best Overall
Sale
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents

Check device scale when the file has too many pixels

Viewport dimensions control the CSS layout area; they do not necessarily equal the image’s pixel dimensions. HTML/CSS to Image’s FAQ says images render at 2× by default. If the viewport is correct but the output image is twice as wide and high in pixels as you expected, set device_scale to 1 for 1× output. This changes the rendered pixel resolution without changing the CSS viewport. The documented device_scale range is 0.1 to 3.

{
  "url": "https://example.com",
  "viewport_width": 1200,
  "viewport_height": 630,
  "device_scale": 1
}

Use device_scale to change output resolution, not to make a responsive page adopt a different layout. For a different layout breakpoint, change the viewport width.

Use mobile viewport behavior when you need a mobile layout

Choose the intended mobile width and height, then set viewport_mobile to true if the page should use mobile viewport behavior, including its <meta name="viewport"> settings. The flag does not choose the dimensions; the width and height do.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
{
  "url": "https://example.com",
  "viewport_width": 390,
  "viewport_height": 844,
  "viewport_mobile": true
}

If a page still looks like its desktop design, verify the requested width first, then check whether mobile viewport emulation is enabled when needed.

Find out why the captured region is unexpectedly tall or cropped

Full-page capture

With full_screen: true, the service captures the full scrollable page. The resulting image can be taller than viewport_height; that does not necessarily mean the viewport was ignored. Turn full-page capture off when you want only the viewport’s visible area. See the full-screen parameter documentation.

Element capture

To capture one component rather than the whole visible page, use the selector parameter to target the element. Check that the selector matches the intended element and that the element is present when rendering occurs. The parameter reference lists available parameters.

Rank #3
Sale
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.

Small standalone HTML snippets

If you are rendering a compact HTML graphic and want it tightly trimmed, size the content in CSS rather than setting explicit viewport dimensions. The viewport documentation notes that explicit dimensions disable automatic cropping and return the area rendered inside the viewport.

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

Do not use output resizing to fix a layout breakpoint

The API’s width and height query parameters resize the generated image after rendering. They do not change the viewport or rerender the page at a different CSS layout size. Use viewport settings to fix responsive layout; use output resizing only when the rendered image is right and you specifically want a different final image size. Parameter behavior is described in the API documentation.

Check render timing only when content is missing

If the dimensions are correct but JavaScript-built content, text, or images are absent, investigate readiness rather than viewport geometry. The parameter reference describes ms_delay as a wait before generation, which can help allow JavaScript to run, and lists render_when_ready for pages that call ScreenshotReady(). These settings address content readiness, not image dimensions.

Rank #4
Sale
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient

Troubleshooting checklist

  1. Wrong responsive layout: set both viewport_width and viewport_height to the desired CSS viewport size. Use a width at the breakpoint you want.
  2. Output pixels are larger than expected: check the default 2× rendering and set device_scale to 1 if you want 1× output.
  3. Mobile layout is not taking effect: use mobile-sized viewport dimensions and set viewport_mobile to true when mobile viewport behavior is needed.
  4. Image is taller than the viewport: check whether full_screen: true is capturing the scrollable page.
  5. Only a component should appear: target it with selector; for a small standalone graphic, size the HTML content in CSS and avoid explicit viewport dimensions if automatic trimming is desired.
  6. Content is missing, not mis-sized: check ms_delay or render_when_ready as appropriate.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. One GET request can return a PNG, JPEG, WebP, or PDF; the request below saves a WebP screenshot. See the ScreenshotNeo documentation for API options.

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

ScreenshotNeo accepts cookie banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify page verdict and billing status in headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents. The free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots.

Free tools Windows power users keep installed

One-click scans. No signup required.

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

Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.

Frequently Asked Questions

What is the default HTMLCSStoImage viewport?

The vendor’s viewport documentation lists 1920 × 1080 as the default viewport.

Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.

What is the maximum viewport width?

The documented maximum viewport width is 6000 CSS pixels; the reviewed documentation does not state a maximum height.

Does setting viewport dimensions change the responsive breakpoint?

Yes. The viewport width determines which responsive CSS media queries apply; changing only output image size does not.

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

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.

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
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

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.