Mobile best practices
ShortStack campaigns adjust to phone screens on their own, but a few choices make them look better. Put important images in Image Widgets, not backgrounds, use percentages for side spacing, show or hide widgets by screen width, and check every width with the Ruler and Mobile preview before you publish.
What we recommend
| Practice | Why it matters |
|---|---|
| Put important images in Image Widgets | Image Widgets shrink to fit the screen. |
| Keep key information out of background images | Background images don't shrink, so they can be cut off. |
| Use percentages for side spacing | Spacing set in pixels can squeeze content on a small screen. |
| Show or hide widgets by screen width | Show a simpler version on phones, and a fuller one on computers. |
| Check every width before you publish | Catch layout problems before your audience does. |
Put important images in Image Widgets
The Image Widget shrinks large images, including their hotspots, to fit the screen.
An image set as a widget's background doesn't. Background images aren't responsive, so on a smaller screen they're cropped to fit, and part of the image is cut off.
Keep key information out of background images
Background images don't shrink to fit the screen, so on a phone they can be cut off. Don't put text, a prize photo or anything else people need to see in a background image. Use an Image Widget instead.
To make a campaign's background image fit the screen, use Background Size/Position in the Style Panel's Page section. See Getting started with the Style Panel.
Use percentages for side spacing
Padding and margins set in pixels stay the same size on every screen, so on a phone they can squeeze your content. Set the left and right spacing as a percentage instead, so it grows and shrinks with the screen.
A good way to work: design in pixels first, then change the left and right values to percentages.
For example, instead of 80 pixels of padding on each side:
use 10 percent:
The side padding now changes with the screen, while the top and bottom stay at 10 pixels.
Show or hide widgets by screen width
-
Select the widget or container.
-
In the Style Panel, go to the This Widget tab.
-
Open the Widget section, and find the Widget Visibility options.
-
Choose a width for one of these:
Option Use it to Hide Widget At This Width or Less Hide the widget on smaller screens, such as phones. Hide Widget At This Width or Greater Hide the widget on larger screens, such as computers.
For example, to show a widget only on phones, choose the middle width under Hide Widget At This Width or Greater.
Check every width before you publish
- In the builder: click inside the Ruler at the top of the Campaign Builder to see the campaign at 320 pixels (a phone held upright), 480 pixels (a phone held sideways), 768 pixels (a tablet) and 1024 pixels. See Preview width.
- On your phone: hover over the Mobile preview icon in the toolbar and scan the QR code. See Testing your campaign.
Change the viewport meta tag
Advanced. ShortStack adds this tag to every campaign, so it fits phone screens:
<meta name="viewport" content="width=device-width, maximum-scale=1">
If you know how the viewport tag works and need something different, add your own viewport meta tag to a Code Widget in your campaign. It overrides the default.
If something goes wrong
| What you see | What to do |
|---|---|
| A background image is cut off on phones | Move the important part into an Image Widget, or set Background Size/Position in the Style Panel. |
| Content is squeezed on phones | Change left and right padding and margins from pixels to percentages. |
| A hotspot is hard to tap on a phone | Make the hotspot bigger. Hotspots shrink with their image. |
| A widget shows on the wrong devices | Check its Widget Visibility widths in the Style Panel. |
| The campaign looks right in the builder but not on your phone | Scan the Mobile preview QR code to check it on a real phone, and click through every width on the Ruler. |
FAQs
Why is my background image cut off on phones?
Background images don't shrink to fit the screen. Put anything important, such as text or a prize photo, in an Image Widget instead, which does.
How do I show a widget only on phones?
Select the widget, and in the Style Panel's Widget section, use Hide Widget At This Width or Greater. See Show or hide widgets by screen width.
Does the Ruler change my campaign's width?
No. It only changes the preview in the builder. To change the campaign's width, use Maximum Content Width in the Style Panel's Page section.
Related resources
Was this helpful?
Thanks — that helps us decide what to fix next.
Sorry this missed. Tell us what you needed and we'll get you an answer — and fix the page.