To create a responsive side navigation bar in Webflow that avoids overlapping with your main content, you should use a flexbox or grid layout and ensure both the sidebar and the content area scale properly with the viewport.
1. Use a Flexbox Layout for the Page Wrapper
- Wrap your entire layout (sidebar + content) inside a parent
div
named something like Page Wrapper. - Set the Page Wrapper to Display: Flex with Horizontal (Row) direction.
- This allows elements inside to sit side by side and resize automatically.
- Inside the Page Wrapper, add a
div
for your sidebar (e.g. Sidebar). - Set the width to a fixed value (e.g. 250px) or a percentage like 20%.
- Set Flex Child: Don’t shrink to prevent it from collapsing on smaller screens.
- Optionally, use Position: Sticky with top: 0px if you want the sidebar to remain in view while scrolling.
3. Create a Responsive Main Content Area
- Add another
div
next to the sidebar for Main Content. - Set this to width: auto or use Flex Child: Fill so it takes up all remaining space.
- Add padding-left if needed to add spacing without affecting layout structure.
- Use overflow: auto or scroll if this section needs vertical scrolling.
- At smaller breakpoints (e.g., Tablet or Mobile), consider:
- Hiding the sidebar with Display: None, or
- Moving the sidebar above the content using Flex Direction: Column on the Page Wrapper.
- You can also implement a menu button to toggle the sidebar (like a collapsible drawer/menu).
5. Set Max Width on Content (Optional)
- To avoid the main content getting too wide on large screens, set a max-width and center it using margin-left: auto and margin-right: auto within the content section.
Summary
To build a non-overlapping, responsive side navigation bar in Webflow, use a flexbox layout with a fixed-width sidebar and a flexible content area. Adjust for mobile using breakpoints and flex direction changes to maintain usability across all screen sizes.