How do I make sections full width?
Last checked 31 Aug 2026
Short answer
Remove the container's max-width constraint for that section and make its background span the full viewport width, while keeping the inner content in a centred, max-width column for readability.
Full-width background, contained content
Most "full width" requests actually mean: the background colour/image should reach both screen edges, but the text and buttons inside should stay readable in a centred column (not stretch edge-to-edge on a wide monitor). Ask for both parts explicitly:
Make the hero section's background span the full width of the viewport, but keep the text and CTA inside a centred column with a max-width of around 1200px.
How it's typically structured
- The outer wrapper gets full width (
w-full, nomax-w-*, no side margins) and holds the background colour or image. - An inner wrapper keeps
max-w-7xl mx-auto px-4(or similar) so content doesn't stretch uncomfortably wide on large screens.
Truly edge-to-edge content
If you actually want the content itself (not just the background) to reach the edges — a full-bleed image gallery, for example — say so explicitly, since it's a different and less common request:
Make the image gallery section completely edge-to-edge, including the images themselves, with no side padding at any screen size.
What usually goes wrong
- Asking for "full width" without specifying whether the content should also stretch — Lovable may either leave content narrow or overstretch it. Be explicit about which parts.
- Removing a container's max-width globally instead of for one section, which can break other pages that depended on that shared container.
- Full-width sections with edge-to-edge padding that disappears on mobile, causing text to touch the screen edge — recheck mobile after this change.
Sources
Was this answer helpful?
Related questions
- AnswerHow do I make my Lovable website look less AI-generated?Set a real colour palette, a font pairing and spacing scale up front, then ask Lovable to remove generic gradients, stock-photo hero clichés and default shadcn styling so the site reads as bespoke.
- AnswerHow do I add animations?Ask for specific, subtle animations (fade-in on scroll, hover states, a smooth page transition) rather than "add animations" generally — Lovable can use Tailwind transitions or a library like Framer Motion depending on what you need.
- AnswerHow do I improve accessibility?Ask Lovable to check colour contrast, add alt text to images, ensure keyboard navigation works, and use semantic HTML/ARIA labels — these cover most common accessibility gaps in generated sites without needing a full audit tool.
- AnswerHow do I make a sticky header?Ask Lovable to make the header `fixed` or `sticky` at the top with a defined z-index, and add top padding to the page content equal to the header's height so it isn't hidden underneath.