Menu
FeaturesPricingAboutFAQGuidesNPS calculatorTemplatesSign inView 7-day trial

Making a tour usable when the browser zooms

Using relative units so the tour scales

When a user zooms the browser to 150% or 200%, fixed-pixel tooltips either overflow the viewport or become too small to read. Build every tour dimension — width, padding, font-size, arrow offset — with rem or % so they scale with the user’s root font size.

Set the tooltip root: .tour-tooltip { font-size: 1rem; max-width: 20rem; padding: 1rem; }. The arrow uses border-width: 0.5rem. Because 1rem equals the browser’s current base size (often 16px at 100%, 24px at 150%), the whole tooltip grows proportionally.

Preventing layout breakage at high zoom

At 200% zoom a 20rem tooltip becomes 640px wide — wider than many viewports. Add a responsive clamp:

.tour-tooltip {
  max-width: min(20rem, calc(100vw - 2rem));
}

This keeps the tooltip readable but never wider than the viewport minus a small margin.

Worked example: arrow misalignment at 175%

Before – Tooltip positioned with left: 200px; top: 100px;. At 175% zoom the target element moves (because page layout reflows) but the tooltip stays at the old coordinates. The arrow points at empty space.

After – Positioning uses a ResizeObserver on the target element. On every resize callback, recalculate target.getBoundingClientRect() and update the tooltip’s transform: translate(...). The arrow stays glued to the target at any zoom level. Verification: open page, set zoom to 175%, start tour, confirm arrow tip touches the target element on all steps.

Reusable zoom-safe CSS snippet

.tour-tooltip {
  font-size: 1rem;
  max-width: min(20rem, calc(100vw - 2rem));
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
  box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.15);
}
.tour-arrow {
  border-width: 0.5rem;
  margin: 0 auto;
}

Exception: if the tour runs inside an iframe with a fixed pixel width (e.g., an embedded widget), rem units inherit the parent page’s root size, not the iframe’s. In that case, detect the iframe context and fall back to px values calculated from the iframe’s computed font size.

Result: the tour remains readable, correctly positioned, and fully usable at any browser zoom level.

Related: Onboarding Tours features.