Lorixen.
EN

Embedded Booking Widget Clipped or Double-Scrolling? Choosing a Height Strategy for the iframe

Short answer: An iframe does not know how tall its content is, because the content belongs to another website. That is why embedded booking widgets get cut off, show two scrollbars, or leave a large blank gap after the last step. You have four realistic choices: a generous fixed height, a height that depends on screen width, the provider's own auto-resize script, or linking out to a full-page booking screen. Pick based on how many steps the widget has and whether the provider supports resizing messages.

Why it happens

The widget inside the frame changes height as the visitor moves through it. Step one may be a calendar of 450 pixels. Step three may be a form of 900 pixels. Your page set the iframe to, say, 600 pixels when you pasted the snippet. On the calendar there is empty space. On the form the bottom is clipped, and the visitor scrolls inside the frame while the page behind stays still. On a phone the widget's own layout reflows into a taller column, so the problem gets worse exactly where most bookings happen.

Browsers prevent your page from reading the height of a cross-origin frame for security reasons, so you cannot fix this with a simple script of your own unless the provider cooperates.

The four options compared

Option How it works Good for Weak points
Fixed tall height Set height to the tallest step plus a margin Short widgets with predictable steps Blank gap on early steps, clipping on small screens
Height by breakpoint Different heights set in CSS for phone, tablet and desktop Widgets with two or three known layouts Still guesswork; breaks when the provider updates their design
Provider auto-resize A script from the provider sends height messages and the frame adapts Multi-step widgets with active vendors Needs vendor support, an extra script, and trust in it
Link out or full-page view A button opens the booking tool on its own page Long, complex bookings or tight pages The visitor leaves your site unless you use a custom domain

As of November 2026, many booking and form vendors offer an embed script with an auto-resize option, but not all do, so check their help centre before choosing.

Option 1: a fixed height done carefully

Open the widget yourself and walk through every step on a phone. Note the tallest. Use that height plus about 40 pixels for the iframe. Make sure the width is 100 percent and give the frame a title attribute such as "Book a table" so it has an accessible name.

<iframe src="https://booking.example.com/widget" title="Book an appointment"
        style="width:100%; height:1100px; border:0;"></iframe>

To reduce the empty gap, avoid putting content directly beneath the frame that looks broken when white space appears. A neutral background colour matching the widget helps.

Option 2: breakpoints

Add CSS that sets a different height at each width where the widget reflows:

.booking-frame { height: 1300px; }
@media (min-width: 48rem) { .booking-frame { height: 950px; } }
@media (min-width: 70rem) { .booking-frame { height: 780px; } }

Record the dates and values in a note so a future editor knows why they exist. Retest after the vendor announces redesigns.

Option 3: auto-resize through messages

With vendor support, the widget calls window.parent.postMessage with its new height whenever content changes, and a listener on your page adjusts the iframe:

window.addEventListener('message', function (e) {
  if (e.origin !== 'https://booking.example.com') return;
  if (e.data && e.data.type === 'resize') {
    document.querySelector('#booking').style.height = e.data.height + 'px';
  }
});

The origin check is essential. Without it, any other site could send height values to your page. Use the message names and format from the vendor documentation, since the example above is generic and invented for illustration. Often the vendor supplies a ready-made snippet that does all this; use it rather than writing your own.

A button that opens the full-page booking view gives the best mobile experience for long journeys, with no clipping, no scroll trap and the browser's autofill working normally. Decide whether it opens in the same tab. Many providers allow a custom domain such as book.yourbusiness.ca so the visitor does not feel they have left.

Fixing the double scrollbar

If you see two vertical scrollbars, the frame is shorter than the content. Either increase the height or let the frame scroll but remove the page's own scroll trap by ensuring the frame is not nested in a container with overflow: auto and a fixed height. Avoid scrolling="no" unless you know the content never exceeds the frame; the attribute is deprecated, and hiding scrolling cuts the last button off for anyone who cannot enlarge the frame.

Accessibility and keyboard checks

  • [ ] The iframe has a meaningful title.
  • [ ] Tab moves into the widget and then out of it at the end.
  • [ ] Focus rings inside the widget are visible.
  • [ ] After a step changes, the page does not leave the visitor at the bottom of the frame looking at the wrong region.
  • [ ] Zooming to 200 percent does not hide the submit button.

Speed and privacy

An iframe loads another website inside yours. Use loading="lazy" on frames placed well below the top of the page, and consider showing a button that loads the widget on click if it sits at the top and slows your page. Check whether it sets cookies; if so, your consent setup should account for it.

FAQ

Can I read the iframe's content height myself?

Not for a different domain. The browser blocks it, so you need a message from the widget.

Why does it look fine on my laptop and clipped on my phone?

The widget re-flows into a taller column on narrow screens, and your fixed height does not account for it.

Is a link out worse for conversions?

It depends on the audience. Test both with your own traffic rather than assuming.

Should I make the iframe full viewport height?

Using height: 100dvh can work for a dedicated booking page with no header, but not for an embed in the middle of content.

If you would like your booking embed to behave on every screen, send us the details through our enquiry page.

Sources

WhatsAppBook a call