Standard Markdown has no universal image-size parameter. This displays an image, but does not specify its width:
1To control the size, use your documentation platform's image controls, supported HTML, or an MDX component. The right choice depends on what renders the page. A snippet that works in an MDX site can be rejected, stripped or ignored by a different Markdown service.
For a help-center screenshot, the objective is usually simple: show the relevant controls at a readable size, preserve the original proportions and avoid overflowing a phone screen. This guide works through those decisions without treating every renderer as interchangeable.
Choose the sizing method your renderer supports
| Where the article is rendered | Start with | Check before publishing |
|---|---|---|
| A Markdown service with a built-in image editor | Its display-width or image settings | Whether export retains the chosen size |
| Markdown with permitted raw HTML | An HTML image with dimensions, plus supported responsive CSS | Whether HTML or style attributes are sanitized |
| An MDX documentation site | A JSX image or the site's image component | Component props, source paths and React style syntax |
| A Markdown renderer you do not control | Standard image syntax and an appropriately prepared source file | Whether it supports an extension for dimensions |
The CommonMark image specification defines the destination, alternative text and optional title. Width and height are not part of that standard image syntax. Formats such as  are renderer-specific extensions, not portable Markdown.
Do not hide a crucial instruction in a screenshot simply because you cannot choose a display width. Write the action in the article text as well.
Resize with HTML when raw HTML is allowed
For a source image that is 1280 pixels wide and 720 pixels high, these proportional dimensions request a smaller display:
1<img2 src="/images/notification-settings.png"3 alt="Notification settings with email alerts enabled"4 width="640"5 height="360"6/>These are illustrative paths; substitute an image that exists in your site. The dimensions retain the source's 16:9 ratio. They do not create a smaller image file or remove sensitive information from it.
HTML support is a prerequisite, not a guarantee. A hosted Markdown service may filter attributes, apply its own image component or disallow raw HTML. For example, the GitHub Flavored Markdown specification notes that GitHub performs additional sanitization after converting Markdown to HTML. Test the actual destination rather than assuming that a local preview has the same policy.
Keep the image inside a narrow article column
If you control the site's stylesheet, apply a class:
1<img2 class="help-screenshot"3 src="/images/notification-settings.png"4 alt="Notification settings with email alerts enabled"5 width="640"6 height="360"7/>1.help-screenshot {2 display: block;3 max-width: 100%;4 height: auto;5}Here, the chosen display width can shrink to fit the containing column, while the height follows the image's proportions. MDN's max-width reference explains how a maximum constrains an element's used width. A percentage is relative to the containing block, not necessarily the whole browser window.
If the platform permits inline CSS but not a custom stylesheet, it may accept this HTML version:
1<img2 src="/images/notification-settings.png"3 alt="Notification settings with email alerts enabled"4 width="640"5 height="360"6 style="display: block; max-width: 100%; height: auto;"7/>Use this only where inline styles are supported. A sanitizer can remove the style attribute, and a site's stylesheet may impose other sizing rules.
Use JSX syntax for MDX image styles
MDX supports JSX. Its style prop uses a JavaScript object, not an HTML style string. A plain image can look like this:
1<img2 src="/images/notification-settings.png"3 alt="Notification settings with email alerts enabled"4 width={640}5 height={360}6 style={{ display: 'block', maxWidth: '100%', height: 'auto' }}7/>Notice maxWidth, rather than max-width, inside the object. That is React's style convention. The React style documentation covers camel-cased property names and object values.
Your site may provide an Image, Screenshot or other component instead of a native img element. Check its documented props before substituting it. A framework's image component can require different source handling or dimensions; its API is not defined by Markdown.
When a page fails to compile, inspect the syntax before changing the asset. Unclosed tags, malformed braces and HTML-style strings used as React style props are different problems from a file being too large. Our MDX preview and production parity walkthrough demonstrates a separate failure mode: preprocessing can change source that originally compiled correctly.
Width and height should describe the same proportions
Suppose the original screenshot is 1200 by 800 pixels. A width of 600 and a height of 400 retain its 3:2 ratio. A width of 600 and a height of 200 do not.
Choose one of these approaches deliberately:
- Provide proportional dimensions and allow responsive CSS to shrink the image.
- Set a display width and allow height to follow automatically, using the controls your platform supports.
- Crop the source to a new composition, then use dimensions matching that new file.
Cropping and stretching are not equivalent. Cropping can remove an irrelevant sidebar; stretching changes the shape of every label and control. If you crop, check that the screenshot still provides enough context to identify the right screen.
Accurate dimensions also help browsers reserve space before an image loads. The web.dev layout-shift guide explains why missing image dimensions can cause content to move. Do not remove all dimensions as a universal performance fix; coordinate them with the actual aspect ratio and responsive rules.
Display size is not compression
A large screenshot displayed at 640 pixels can still transfer the original large file. Reducing its CSS width does not resample or compress it.
Treat these as separate decisions:
| Decision | What changes | What it does not solve |
|---|---|---|
| Display width | How much layout space the image uses | Original file weight |
| Resize the source file | The image's pixel dimensions | Whether the page fits mobile layouts |
| Compress or change format | The encoded file and possibly visual quality | Incorrect screenshot content |
| Crop | Which part of the screenshot remains | Missing written instructions |
Start by removing unnecessary screen area. Then prepare an appropriately sized source and inspect labels at the intended display size. Over-compression can make small UI text difficult to read; serving a huge original can waste transfer without improving the task.
A higher-density source can help on a high-density display, but it is not a reason to upload every screenshot at the maximum available size. Choose based on the actual content and reading surface. MDN's image reference documents responsive source selection with srcset and sizes where your platform supports it.
Resize images in the DocsAlot editor
For supported image blocks, the DocsAlot editor provides a Display width (px) field, Apply size and Auto. Enter a whole-number width from 1 to 4096, or choose Auto to remove the explicit display-width choice. This controls presentation; it does not upload or resample the original asset.
After applying a size, preview the article in its actual layout. A width that works in a wide article can be too much inside a table or narrow callout. If you publish through Markdown or MDX files instead, verify how the source attributes are preserved by that path rather than assuming that every external renderer uses the editor's rules.
For a migration, include screenshot paths and important image dimensions in your acceptance review. Our documentation migration checklist covers the broader content, URL and access checks.
A practical screenshot review before publishing
Use one representative how-to article, not just an isolated image file:
- Open the article at desktop width and then in a narrow viewport. Check for horizontal overflow and unreadably small labels.
- Follow the task using the written steps. The image should clarify the action, not carry the only copy of a required setting.
- Confirm the screenshot matches the current product. A sharply rendered image of an old menu is still misleading.
- Check alternative text. Describe the useful information or function, rather than repeating the filename. The W3C alternative-text decision tree helps distinguish informative and decorative images.
- Verify that no names, credentials, private tickets or account details remain visible. Display-width settings do not redact the source file.
- Publish to a review surface and inspect the final rendered page. Compilation alone cannot establish readability, responsive behavior or sanitizer behavior.
For repeated support procedures, use a consistent knowledge-base article template. For simple text comparisons, a Markdown table is often more searchable and easier to update than a screenshot of a spreadsheet.
Troubleshooting common image-size problems
| Symptom | Check first | Likely next action |
|---|---|---|
| The size suffix appears in the URL or does nothing | Whether the renderer supports that Markdown extension | Use its documented controls or supported HTML |
| The image becomes distorted | Width, height and source aspect ratio | Restore proportional dimensions and automatic height |
| The image overflows on a phone | Container width and applied CSS | Add supported responsive constraints or fix the component |
| Inline styles disappear | Sanitization or content policy | Use an approved class or platform image controls |
| The screenshot is blurry | Source detail at the final display size | Recapture or prepare a better source rather than only enlarging it |
| The MDX page fails to compile | JSX tags, braces and style syntax | Correct the source; resizing the binary image will not fix syntax |
| A small displayed image still loads slowly | Original file weight and delivery path | Optimize the source separately from display dimensions |
The reliable rule is to separate syntax, layout and the source asset. Confirm what the renderer accepts, preserve the image's proportions and prepare a file that makes the support task easy to complete.