Skip to main content
0 reactions

Fixed: n8n Form Ending Page Cut Off on Mobile

Featured card: Fixed: n8n Form Ending Page Cut Off on Mobile. Two phones, one with a box running past the right edge of the screen and one where it fits, with the facts Ending page: 448 px wide and Fix: Custom Form Styling.
Fixed: n8n Form Ending Page Cut Off on Mobile

On a phone, the last page of my n8n form ran off the right edge of the screen, while the three pages before it fit. That last page is the Form Ending page, and n8n draws it 448 pixels wide on every screen. A short CSS rule in the node’s Custom Form Styling option made it fit on mobile.

What I Was Doing

I was checking the event sign-up form from How to Set Up and Run the Event Sign-up Form for n8n on a phone-sized screen, 390 pixels wide, in n8n 2.49.5 running in Docker. The form has three pages and ends with an n8n Form node set to Form Ending, which shows You’re booked! with the visitor’s name, session and seats.

What I Expected

The last page to fit the screen, like the three pages before it.

What I Got

The three form pages fit. The last page didn’t: its box ran past the right edge of the screen, and the end of the message was cut off.

The You’re booked! page of an n8n form on a screen 390 pixels wide: the box around the message runs past the right edge, and the end of the first line, Thanks, Meera Nair. You’re booked for Saturday 12, is cut off.
On a 390-pixel screen, the ending page runs past the right edge.

What I Checked

Only the last page was too wide, so I compared the two templates n8n builds its form pages from, in n8n’s GitHub repository at version 2.49.5:

packages/cli/templates/form-trigger-completion.handlebars (excerpt)CSS
.container {
	margin: auto;
	text-align: center;
	padding-top: var(--padding-container-top);
	width: var(--container-width);
}

Why It Happens

A phone’s screen is narrower than 448 pixels; this one is 390. The Form Ending page keeps its 448-pixel box on every screen, so on a phone the box runs past the edge. The form pages don’t have this problem: on screens up to 500 pixels wide, n8n makes them 95% of the screen’s width and drops the border around the box.

The Fix

Give the Form Ending page the same rule for small screens. The node has an option for this, Custom Form Styling, which n8n’s Form node docs (opens in a new tab) describe as overriding the default styling of the form with CSS. n8n adds this CSS after its own styles, so your rules win.

Open your workflow and double-click the Form Ending node. Under Options, click Add option, then Custom Form Styling:

The settings of an n8n Form node with Page Type set to Form Ending and, under Options, the Add option list open with Completion Page Title, Append n8n Attribution and Custom Form Styling.
Options › Add option › Custom Form Styling.

n8n adds the option and fills its box with its default styles: a list of fonts, sizes and colours, the same values the page already uses.

The Custom Form Styling box of the Form Ending node right after it is added, filled with n8n’s default styles: a list of font families, font sizes and colours.
n8n fills the box with its default styles.

Click in the box, select everything (Cmd+A on a Mac, Ctrl+A on Windows) and paste these lines in its place:

Custom Form StylingCSS
/* Fit the page to phone screens */
@media only screen and (max-width: 500px) {
	.container {
		width: 95%;
		padding: 24px;
	}
	.card {
		padding: 0;
		border: 0;
		box-shadow: none;
	}
}

The rule works only on screens up to 500 pixels wide, with the values n8n’s form pages use there: the page takes 95% of the screen, and the box around the message loses its border. On a computer, nothing changes.

The Custom Form Styling box of the Form Ending node with the new CSS: a comment, then a rule for screens up to 500px wide that makes the container 95% wide with 24px padding and removes the card’s padding, border and shadow.
The phone rule in Custom Form Styling.

Close the node. n8n saves the change as you work, but the live form keeps the published version until you click Publish again; How to Publish a Workflow in n8n shows how. If the workflow has more than one Form Ending node, add the same lines to each.

After the Fix

With the lines in place and the workflow published, I booked again on the same 390-pixel screen. The last page now fits, laid out like the pages before it:

The You’re booked! page on the same 390-pixel screen after the fix: the message Thanks, Kabir Shah. You’re booked for Saturday 12 December, 10:00: 3 seats. fits the screen on two lines.
After the fix, the ending page fits the screen.

On a computer, the page looks the same as before.

Common Mistakes

MistakeWhat happensDo this instead
Adding the CSS to the Form Trigger or to a form pageThe ending page is still cut off: it uses only its own node’s Custom Form StylingAdd it under the Form Ending node’s Options
Adding it to one Form Ending node when the workflow has severalThe other ending pages are still cut off on phonesAdd the same lines to every Form Ending node
Not publishing again after the changeThe live form still shows the old ending pageClick Publish again

FAQ

Does the CSS change the page on a computer?

No. It sits inside a rule for screens up to 500 pixels wide, so wider screens keep n8n’s usual layout.

Do the form pages need it too?

No. n8n already lays them out for small screens. Only the Form Ending page lacks that rule.

Can I keep n8n’s default styles in the box?

Yes. They hold the same values the page already uses, so you can paste the lines after them instead of replacing them.

Does a Form Ending set to Show Text have this problem?

No. With Show Text, n8n shows your own HTML instead of its 448-pixel box, so the layout is whatever your HTML sets.

Conclusion

n8n’s Form Ending page is 448 pixels wide on every screen, so it runs off a phone’s screen while the form pages adapt. Add the phone rule to each Form Ending node under Options › Custom Form Styling, publish again, and the last page fits like the rest of the form.

Additional Resources

n8n and other names mentioned are trademarks of their respective owners. JD Bots isn’t affiliated with or endorsed by n8n GmbH.

0 comments