{"id":624,"date":"2023-09-08T09:11:00","date_gmt":"2023-09-08T09:11:00","guid":{"rendered":"https:\/\/blog.hostinger.io\/support\/2023\/09\/08\/8347670-hostinger-website-builder-how-to-change-the-header-section-color-on-specific-pages\/"},"modified":"2026-03-16T12:12:02","modified_gmt":"2026-03-16T12:12:02","slug":"8347670-hostinger-website-builder-how-to-change-the-header-section-color-on-specific-pages","status":"publish","type":"post","link":"https:\/\/www.hostinger.com\/support\/8347670-hostinger-website-builder-how-to-change-the-header-section-color-on-specific-pages\/","title":{"rendered":"Hostinger Website Builder: How to change the header section color on specific pages"},"content":{"rendered":"<p class=\"no-margin\">By default, you can set only one <a class=\"intercom-content-link\" href=\"\/support\/6463972-website-builder-how-to-customize-the-style-of-the-navigation-menu#h_5fd2929943\" target=\"_blank\" rel=\"noopener\">header background color<\/a> in Hostinger Website Builder. However, it is possible to keep the header transparent, which will make it take the same color as the first section of each page.<\/p><p>This can be done by clicking&nbsp;<strong>Edit header<\/strong>:<\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-8573 size-large\" src=\"https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/03\/builder-header-1024x127.png\" alt=\"\" width=\"1024\" height=\"127\" srcset=\"https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/03\/builder-header-1024x127.png 1024w, https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/03\/builder-header-300x37.png 300w, https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/03\/builder-header-768x96.png 768w, https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/03\/builder-header-1536x191.png 1536w, https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/03\/builder-header-2048x255.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p><p>Then, open the tab&nbsp;<strong>Style<\/strong>, and toggle on&nbsp;<strong>Transparent header<\/strong>. In this specific case, this would make the header purple, taking the color of the narrow section about free shipping:<\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-8600\" src=\"https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/03\/transparent-background.png\" alt=\"\" width=\"500\" height=\"478\" srcset=\"https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/03\/transparent-background.png 1228w, https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/03\/transparent-background-300x287.png 300w, https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/03\/transparent-background-1024x979.png 1024w, https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/03\/transparent-background-768x734.png 768w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/p><p data-start=\"367\" data-end=\"562\">Alternatively, if you want to use different header background colors on different pages, you can do so using <a class=\"intercom-content-link\" href=\"\/support\/6445594-website-builder-how-to-add-custom-code-to-the-head-head-part-of-a-website-s-code\" target=\"_blank\" rel=\"noopener\">custom code<\/a>.<\/p><div class=\"intercom-interblocks-callout\" style=\"background-color: #e3e7fa80;border-color: #334bfa33\">\n<p class=\"no-margin\">&#128161; Changes made via custom code will be visible in preview mode and online, but not within the editor.<\/p>\n<\/div><h2 id=\"h-steps\">Steps<\/h2><ol>\n<li>Copy the code below for your desired setup into a plain text editor: one specific page, multiple pages, or all pages except one.<\/li>\n<li>Customize the code:\n<ol>\n<li>Replace <code data-start=\"982\" data-end=\"990\">'#f00'<\/code> with your preferred color name (e.g., <code data-start=\"1029\" data-end=\"1038\">'green'<\/code>) or <a href=\"https:\/\/g.co\/kgs\/mXBk22\">HEX code<\/a> (e.g., <code data-start=\"1059\" data-end=\"1070\">'#008000'<\/code>).<\/li>\n<li>Replace the page path (e.g., <code data-start=\"1109\" data-end=\"1121\">'\/contact'<\/code>) with the <strong data-start=\"1132\" data-end=\"1140\">slug<\/strong> of the page you want to target.<\/li>\n<\/ol>\n<\/li>\n<li>In the Website Builder, go to Settings &rarr; <strong>Integrations<\/strong>.<\/li>\n<li>Paste the code into the <strong>Custom code<\/strong> field and save your changes.<\/li>\n<li>Update your website to apply the changes.<\/li>\n<\/ol><p>&nbsp;<\/p><p><strong>What is a slug?<\/strong><\/p><p data-start=\"1181\" data-end=\"1301\">A slug is the part of a URL that identifies a specific page on your website. For example:<\/p><ul data-start=\"1307\" data-end=\"1448\">\n<li data-start=\"1307\" data-end=\"1352\">\n<p data-start=\"1309\" data-end=\"1352\"><code data-start=\"1309\" data-end=\"1337\">https:\/\/domain.tld\/contact<\/code> &rarr; <code data-start=\"1340\" data-end=\"1350\">\/contact<\/code><\/p>\n<\/li>\n<li data-start=\"1358\" data-end=\"1448\">\n<p data-start=\"1360\" data-end=\"1448\"><code data-start=\"1360\" data-end=\"1389\">https:\/\/domain.tld\/about-us<\/code> &rarr; <code data-start=\"1392\" data-end=\"1403\">\/about-us<\/code><br data-start=\"1403\" data-end=\"1406\">To target the homepage, use <code data-start=\"1439\" data-end=\"1442\">\/<\/code> only.<\/p>\n<\/li>\n<\/ul><p>&nbsp;<\/p><h3 id=\"h_429a2252f1\">Change the header background color on one specific Page<\/h3><p class=\"no-margin\">Copy the code below and customize it:<\/p><div class=\"intercom-interblocks-callout\" style=\"background-color: #e8e8e880;border-color: #73737633\">\n<p class=\"no-margin\">&lt;script&gt;<\/p>\n<p class=\"no-margin\">let newHeaderColor = &lsquo;#f00&rsquo;;<\/p>\n<p class=\"no-margin\">setInterval(() =&gt; {<\/p>\n<p class=\"no-margin\">if (document.querySelector(&lsquo;.background&rsquo;)) {<\/p>\n<p class=\"no-margin\">if (window.location.pathname === &lsquo;\/contact&rsquo;) {<\/p>\n<p class=\"no-margin\">document.querySelector(&lsquo;.background&rsquo;).style.backgroundColor = newHeaderColor;<\/p>\n<p class=\"no-margin\">document.querySelectorAll(&lsquo;.block-header-item__dropdown&rsquo;).forEach(dropdown =&gt; {<\/p>\n<p class=\"no-margin\">dropdown.style.backgroundColor = newHeaderColor;<\/p>\n<p class=\"no-margin\">})<\/p>\n<p class=\"no-margin\">}<\/p>\n<p class=\"no-margin\">else {<\/p>\n<p class=\"no-margin\">document.querySelector(&lsquo;.background&rsquo;).style.backgroundColor = &rdquo;;<\/p>\n<p class=\"no-margin\">document.querySelectorAll(&lsquo;.block-header-item__dropdown&rsquo;).forEach(dropdown =&gt; {<\/p>\n<p class=\"no-margin\">dropdown.style.backgroundColor = &rdquo;;<\/p>\n<p class=\"no-margin\">})<\/p>\n<p class=\"no-margin\">}<\/p>\n<p class=\"no-margin\">}<\/p>\n<p class=\"no-margin\">});<\/p>\n<p class=\"no-margin\">&lt;\/script&gt;<\/p>\n<\/div><h3 id=\"h_53e9859257\">Change the header background color on multiple pages<\/h3><p class=\"no-margin\">Copy the code below and customize it:<\/p><pre><code>&lt;script&gt;\r\n    let newHeaderColor = '#f00';\r\n    setInterval(() =&gt; {\r\n        if (document.querySelector('.background')) {\r\n            if (window.location.pathname === '\/' || window.location.pathname === '\/contact') {                document.querySelector('.background').style.backgroundColor = newHeaderColor;\r\n                document.querySelectorAll('.block-header-item__dropdown').forEach(dropdown =&gt; {\r\n                    dropdown.style.backgroundColor = newHeaderColor;\r\n                })\r\n            }\r\n            else {                document.querySelector('.background').style.backgroundColor = '';\r\n                document.querySelectorAll('.block-header-item__dropdown').forEach(dropdown =&gt; {\r\n                    dropdown.style.backgroundColor = '';\r\n                })\r\n            }\r\n        }\r\n    });\r\n&lt;\/script&gt;<\/code><\/pre><ul>\n<li class=\"no-margin\">To change the header color on more pages, copy this part:<\/li>\n<\/ul><pre><code>|| window.location.pathname === '\/contact'<\/code><\/pre><ul>\n<li class=\"no-margin\">Change the slug (<code>\/contact<\/code>) and add it to the end of the statement, for instance:<\/li>\n<\/ul><pre><code>if (window.location.pathname === '\/contact' || window.location.pathname === '\/about-us' || window.location.pathname === '\/blog')\r\n<\/code><\/pre><p>&nbsp;<\/p><h3 id=\"h_5b5c98f8d4\">Change the header background color on all pages except one<\/h3><p class=\"no-margin\">Copy the code below and customize it:<\/p><pre><code>&lt;script&gt;\r\n    let newHeaderColor = '#f00';\r\n    setInterval(() =&gt; {\r\n        if (document.querySelector('.background')) {\r\n            if (window.location.pathname !== '\/') {                document.querySelector('.background').style.backgroundColor = newHeaderColor;\r\n                document.querySelectorAll('.block-header-item__dropdown').forEach(dropdown =&gt; {\r\n                    dropdown.style.backgroundColor = newHeaderColor;\r\n                })\r\n            }\r\n            else {                document.querySelector('.background').style.backgroundColor = '';\r\n                document.querySelectorAll('.block-header-item__dropdown').forEach(dropdown =&gt; {\r\n                    dropdown.style.backgroundColor = '';\r\n                })\r\n            }\r\n        }\r\n    });\r\n&lt;\/script&gt;<\/code><\/pre><p class=\"no-margin\">\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>By default, you can set only one header background color in Hostinger Website Builder. However, it is possible to keep the header transparent, which will&#8230;<\/p>\n","protected":false},"author":581,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"include_on_kodee":true,"footnotes":""},"categories":[281],"tags":[],"class_list":["post-624","post","type-post","status-publish","format-standard","hentry","category-design"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/support\/8347670-hostinger-website-builder-how-to-change-the-header-section-color-on-specific-pages\/","default":1}],"include_on_kodee":true,"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/624","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/users\/581"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/comments?post=624"}],"version-history":[{"count":3,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/624\/revisions"}],"predecessor-version":[{"id":8601,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/624\/revisions\/8601"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/media?parent=624"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/categories?post=624"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/tags?post=624"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}