Free tools Windows power users keep installed
One-click scans. No signup required.
In Hostinger AI Builder’s manual mode, the built-in header setting applies one background color across the site. For a header that follows each page’s first section, enable Transparent header. For different solid colors on selected pages, use custom code that checks the page URL path, then save and publish the site.
Choose the right method
| Method | What it does | Best for | Trade-off |
|---|---|---|---|
| Transparent header | Makes the header take on the background of the first section beneath it. | A header that should blend into each page’s opening section. | The color comes from that section; you do not choose a separate solid header color for each page. |
| Custom code | Sets a chosen header background according to the current page path. Hostinger’s example also changes header dropdown backgrounds. | Different solid colors on selected pages. | The custom-code result does not appear inside the editor, and Hostinger does not document selector stability or performance. |
Use the transparent header setting
- In the editor, click the header and choose Edit header.
- Open Style.
- Enable Transparent header.
- Check each page’s first section: the header’s apparent color follows the background immediately beneath it.
This is the simpler option when the desired effect is for the header to blend with each page’s opening section, rather than to assign a separate color independently.
As an Amazon Associate I earn from qualifying purchases.
Set solid colors by page with custom code
1. Identify the page paths
The code needs the path portion of each page URL. The homepage path is /; a page whose address ends in /contact may use the path /contact. Use the actual paths on your site. Paths are compared exactly in the example below, so a trailing slash or different page slug can affect whether a match succeeds.
2. Add and adapt the code
Hostinger’s documented approach checks window.location.pathname, applies a color to elements with the .background selector on matching paths, and clears the background on other paths. Its sample also targets .block-header-item__dropdown so dropdown backgrounds change with the header. The following is an illustrative adaptation of that approach; replace the paths and colors with your own:
#1 Best Overall
- CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
- WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
- A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
<script>
(function () {
const pageColors = {
"/": "#1f4e79",
"/contact": "#3b6b45"
};
function updateHeaderColor() {
const color = pageColors[window.location.pathname] || "";
document.querySelectorAll(".background, .block-header-item__dropdown")
.forEach(function (element) {
element.style.backgroundColor = color;
});
}
updateHeaderColor();
setInterval(updateHeaderColor);
})();
</script>
The color values above are examples, not Hostinger defaults. The interval call follows the general pattern described in Hostinger’s support example, which omits a delay; the help material does not discuss performance or provide a tested alternative. Treat this code as an adaptation to verify on your own site, not as independently tested code or a guarantee that the selectors will remain unchanged.
3. Add the snippet and publish
- In the builder, open the more menu and choose Integrations. A related Hostinger help article labels the route Settings → Integrations, so the menu wording may vary.
- Paste the code into Custom code and save.
- Publish or update the website so the change is applied.
Keep a copy of the original snippet so you can remove or restore the change if it causes an unexpected result.
Rank #2
- CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
- SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
Verify the result and troubleshoot
Hostinger says custom-code changes are visible in preview mode and online, but not inside the editor. Check the preview and the published site rather than relying on the editor canvas.
- No page changes color: Compare the page’s actual path with the string in
pageColors. For example,/contactand/contact/are different strings. - The header changes but its dropdown does not: Confirm the dropdown background selector is included. Hostinger’s example uses
.block-header-item__dropdown. - The color appears on the wrong pages: Review every path and color entry in
pageColors; unmatched paths receive an empty background value in this adaptation. - The header is missing in the editor: Hostinger says this can happen when all pages are hidden from the navigation menu. Check the site’s navigation visibility.
Other header controls
The header’s Style settings also include background color, transparency, font, and regular and hover text colors. Header layout and navigation can be edited separately. Hostinger also provides global site colors in the Styles panel and local styling for individual elements; for header navigation styling, use the header settings.
Quick Recap
Best Value
- 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
- 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
- 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
Rank #4
- CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
- SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
- MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
- KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
- INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient
Rank #3
- Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
- Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
- Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
- In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
- Ultra-thin bezels: Maximize your viewing experience with thin bezels.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




