Parts of a before and after slider
A before and after slider shows two images in one frame with a divider the viewer drags across, so a client can see a 1440 px homepage redesign (example) change from the old version on one side to the new version on the other without flipping between two files.
The slider is a presentation tool. It is how you show a client, or a case-study reader, what your work changed. If you need to find what changed between two versions, the compare images tool marks every changed pixel instead.
- Before image
- The starting point: the old site, the unretouched photo, the logo the client had. The slider frame takes this image’s shape, so pick the before image you want the frame to match.
- After image
- Your work. It fills the same frame. When its shape differs from the before image, the edges that do not fit are cropped evenly from both sides, so the centre always lines up.
- Divider
- The line the viewer drags. Left of it (or above it, on a vertical slider) is the before image; the other side is the after image. The start position decides what people see first.
- Orientation
- Horizontal sliders move left and right, which suits wide screenshots and room photos. Vertical sliders move up and down, which suits tall phone screens and long pages.
- Labels
- Small tags such as “Before” and “After”, or “2024” and “2026”, pinned to each side. They help when the change is subtle and a viewer could mix up which side is new.
- Embed code
- A short block of HTML, CSS and four lines of script you paste into your own page. It points at image addresses you host. The class prefix keeps its styles from touching the rest of your site.
- Split image
- A single PNG of the slider frozen at the current divider position. Use it where a slider cannot run, such as an email, a proposal PDF or a social post.
Before and after slider pairs, worked through
These are made-up image pairs, not real projects. Each row runs through the same fitting logic the preview and the embed code use, so you can see what happens to the after image before you export anything.
| Example pair | Before size | After size | Slider frame | What the slider does |
|---|---|---|---|---|
| Homepage redesign, both screenshots 1440 × 900 (example) | 1,440 × 900 | 1,440 × 900 | 8:5 | Same shape: nothing is cropped. |
| Room photo retouch, after cropped wider (example) | 3,000 × 2,000 | 3,200 × 1,800 | 3:2 | After is wider: 15.6% of its width is cropped off the sides. After is smaller, so it is stretched and may look soft. |
| Logo refresh, after exported square (example) | 1,600 × 900 | 1,200 × 1,200 | 16:9 | After is taller: 43.8% of its height is cropped off the top and bottom. After is smaller, so it is stretched and may look soft. |
| Phone screen before, desktop screen after (example) | 390 × 844 | 1,440 × 900 | 0.46:1 | After is wider: 71.1% of its width is cropped off the sides. |
| Re-export a few pixels off (example) | 1,920 × 1,080 | 1,918 × 1,080 | 16:9 | Same shape: nothing is cropped. |
| After saved at half size (example) | 2,400 × 1,600 | 1,200 × 800 | 3:2 | Same shape: nothing is cropped. After is smaller, so it is stretched and may look soft. |
Before you embed a before and after slider
Line the two images up first
The slider only looks good when both images show the same view at the same scale. Take both screenshots at the same browser width, or both photos from the same spot. A shifted crop makes the divider show a jump that is not part of your work.
You host the images, not this page
Your images stay in your browser for the preview. The embed code only points at the addresses you type in, so upload the two images to your own site or CMS first and paste their addresses. Nothing is stored for you here.
Ask before you publish client work
A before and after slider on a case-study page shows the client’s old site or old photos in public. Check your contract or ask in writing before you publish, and leave out anything private that the before image shows, such as names or prices.
Alt text is part of the job
Screen reader users cannot drag to compare. Describe each image in its alt text, saying what changed, for example “Old checkout page with five form steps” and “New checkout page with two form steps”.
Mind the file size
The slider loads both images at once. Export each at the size it will show on the page, in a modern format, so the page stays quick on a phone.
Questions about the before and after slider
How is the before and after slider different from the compare images tool?
Compare images is for you: it marks every changed pixel between V1 and V2 so nothing slips through a round. The before and after slider is for your audience: it presents the change in a way a client or a case-study reader can feel by dragging.
Are my images uploaded by the before and after slider maker?
No. The images are opened on your device for the preview and the split PNG. The embed code uses the web addresses you type in, which should point at copies you have uploaded to your own site.
Does the before and after slider embed code work on any website builder?
It works anywhere you can paste custom HTML that allows a small script, such as an HTML or code block. If your builder strips scripts, the slider still shows both images at the start position, but the divider will not move.
What happens if my before and after images are different sizes?
The frame takes the before image’s shape and the after image is scaled to cover it, with any extra cropped evenly from the edges. The tool shows how much is cropped so you can re-export a matching pair if it is too much.
Can visitors use the before and after slider with a keyboard?
Yes. The divider is a real range control, so it takes focus with Tab and moves with the arrow keys, and screen readers announce it with a label. Touch and mouse dragging work the same way.
Should I send the before and after slider to a client for approval?
A slider is a good way to show a round, but it is not an approval. Ask the client to approve the after version in writing, or use a review tool that records who approved which version and when.