How to create sticky navigation menus on Hostinger
Create sticky navigation menus on Hostinger by adding CSS position: fixed or position: sticky properties to your navigation element through the Website Builder's custom CSS section or by editing your theme files directly. This keeps your menu visible while users scroll through your website.
Prerequisites
- Active Hostinger hosting account
- Website with existing navigation menu
- Basic knowledge of CSS and HTML
- Access to Hostinger's Website Builder or File Manager
Step-by-Step Instructions
Access Your Website Editor
Locate Your Navigation Menu
header.php or index.html) and locate the navigation <nav> or <div> element. Note the class or ID name assigned to your navigation container.Open Custom CSS Editor
style.css file or create a new CSS file to link to your HTML.Add Sticky Navigation CSS
.your-nav-class {
position: sticky;
top: 0;
z-index: 1000;
background-color: #ffffff;
} Replace .your-nav-class with your actual navigation class name. The z-index ensures the menu stays above other content when scrolling.Adjust Menu Styling
box-shadow: 0 2px 5px rgba(0,0,0,0.1); for a subtle shadow effect, and transition: all 0.3s ease; for smooth animations. Set a specific width: 100%; if the menu doesn't span the full width.Test Responsive Behavior
@media (max-width: 768px) { .your-nav-class { position: relative; } } to disable sticky behavior on mobile devices if desired.Save and Publish Changes
Common Issues & Troubleshooting
Navigation menu is not staying sticky when scrolling
Check that your CSS selector matches the exact class or ID of your navigation element. Ensure the parent container doesn't have overflow: hidden which can break sticky positioning.
Sticky menu is hidden behind other content
Increase the z-index value in your CSS to a higher number like z-index: 9999; to ensure the navigation appears above all other page elements.
Menu appears broken or overlapping on mobile devices
Add responsive CSS using @media (max-width: 768px) queries to adjust the sticky menu's behavior, size, or disable it entirely on smaller screens.
Changes are not visible on the live website
Clear your browser cache and any caching plugins. In Hostinger, go to Performance settings and clear the website cache. Wait a few minutes for changes to propagate across all servers.