How to keep content inside a container in Webflow?
Content spilling outside its container is a common layout problem in Webflow. Elements break out of their intended boundaries, overlap siblings, or create horizontal scrolling on the page. This usually comes down to how width, max-width, and overflow are configured.
Constraining width and centering content
The standard approach in Webflow is to use a Container element (available from the Add panel). Webflow's built-in container has a max-width of around 1200px and is auto-centered with margin: 0 auto. Place your content inside this container, and it will stay within those bounds regardless of screen size.
If you're building a custom container instead, set Max Width to your desired value (e.g., 1200px) and set Left and Right Margins to Auto. This centers the container and prevents content from stretching edge-to-edge on wide screens.
Handling overflow
If content still breaks out, check these settings:
Set overflow: hidden on the parent container. This clips any content that exceeds the container's boundaries. In the Style panel, under the Size section, find the Overflow dropdown and set it to Hidden.
Use percentage-based or max-width widths on child elements instead of fixed pixel values. A child set to width: 100% will respect its parent's width. A child set to width: 1500px will overflow a 1200px container every time.
Padding creates inner space
Make sure the container has padding on the left and right sides (e.g., padding: 0 20px). This gives content breathing room from the container edges and prevents text from touching the boundaries on small screens.
Responsive considerations
Check your layout at each breakpoint. Content that fits inside a container on desktop may overflow on tablet or mobile. Use percentage widths and add or adjust padding at smaller breakpoints to keep everything contained.
Quick steps
- Use Webflow's Container element, or set max-width + auto margins on a custom div
- Set overflow to Hidden on the container if needed
- Use percentage-based widths on children instead of fixed pixels
- Add horizontal padding to create inner spacing
- Test at all breakpoints
A properly sized container with auto margins, reasonable padding, and percentage-based children will keep content where it belongs across every screen size.
Want to skip the build?
Browse 60+ premium templates and launch your site in days, not weeks.