How to Move SharePoint Hub Navigation to the Top with an Extended Header
Question details
The user wants to align the hub navigation to the top of the page when using an extended header in SharePoint, ensuring visual consistency between hub sites and associated sites.
- Product
- SharePoint
- Device & OS
- not provided
- Scenario
- Customizing the SharePoint site header and hub navigation layout for a consistent UI.
- Observed behavior
- Extended headers place hub navigation below the header on the hub site, whereas associated sites display the navigation at the top.
Ensure you have the necessary site owner permissions to edit SharePoint pages and add custom web parts like the Modern Script Editor.
Apply Custom CSS via Modern Script Editor
Use a custom CSS snippet to adjust the padding and position of the hub navigation elements on your SharePoint site.
SharePoint does not provide a standard native setting to move hub navigation to the top when an extended header is used. Instead, you must rely on a custom CSS workaround to manually adjust the styling.
Ensure the Modern Page Script Editor web part is deployed and available on your SharePoint site.
Navigate to the SharePoint hub site and click the 'Edit' button in the top right corner.
Click the '+' icon to add a new web part to the page and select the Modern Script Editor.
Click 'Edit snippet' and insert CSS code targeting the '.ms-HorizontalNavItems' class to add bottom padding and adjust header positioning.
Save your code snippet and click 'Republish' to apply the new navigation styling to the live site.

Looking for a Lightweight Document Solution? Try WPS Office
While managing enterprise SharePoint sites can require complex workarounds, creating and managing everyday documents shouldn't be. WPS Office provides a free, lightweight, and highly compatible alternative to Microsoft Office for your daily tasks.
- 1. Download WPS Office: Visit the official WPS website and download the free installer for your operating system.
- 2. Install the Software: Run the setup file and follow the brief on-screen instructions to complete the installation.
- 3. Open Your Files: Launch WPS Office to open, edit, and collaborate on your Microsoft Office-compatible documents seamlessly.

Frequently Asked Questions
Why does my SharePoint hub navigation look different from associated sites?
By default, SharePoint extended headers place the hub navigation below the header on the main hub site. Associated sites typically do not use the same extended header layout, causing their navigation to appear at the top.
Is there a built-in SharePoint setting to move the hub navigation?
No, SharePoint currently does not offer an out-of-the-box setting to reposition hub navigation to the top when an extended header layout is applied.
Are there risks to using custom CSS in SharePoint modern pages?
Yes. Microsoft frequently updates the modern SharePoint user interface. Custom CSS injected via script editors relies on specific class names which may change without notice, potentially breaking your site layout.




