SharePoint Document Issues

How to Move SharePoint Hub Navigation to the Top with an Extended Header

Huda QurayshiHuda Qurayshi Nov 2, 2026 870 views

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.
Before you start

Ensure you have the necessary site owner permissions to edit SharePoint pages and add custom web parts like the Modern Script Editor.

Solution 1Recommended

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.

1
Enable Script Editor

Ensure the Modern Page Script Editor web part is deployed and available on your SharePoint site.

2
Edit the Site Page

Navigate to the SharePoint hub site and click the 'Edit' button in the top right corner.

3
Add the Web Part

Click the '+' icon to add a new web part to the page and select the Modern Script Editor.

4
Inject Custom CSS

Click 'Edit snippet' and insert CSS code targeting the '.ms-HorizontalNavItems' class to add bottom padding and adjust header positioning.

5
Publish Changes

Save your code snippet and click 'Republish' to apply the new navigation styling to the live site.

Apply Custom CSS via Modern Script Editor
Limitations of Custom Styling: Test carefully because custom styling may cover or reposition the site name. Additionally, future SharePoint updates may change default class names, requiring you to update your CSS.
Free Microsoft Office alternative

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. 1. Download WPS Office: Visit the official WPS website and download the free installer for your operating system.
  2. 2. Install the Software: Run the setup file and follow the brief on-screen instructions to complete the installation.
  3. 3. Open Your Files: Launch WPS Office to open, edit, and collaborate on your Microsoft Office-compatible documents seamlessly.
Fully compatible with Microsoft Word, Excel, and PowerPoint formatsFree and lightweight, avoiding the heavy resource usage of enterprise platformsBuilt-in PDF editing, conversion, and annotation toolsFamiliar tabbed interface for a seamless transition
microsoft office alternative - wps office

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.