Add Sitewide Banner to Your Website

Add Sitewide Banner to Your Website

You can call attention to a sale or special announcement by adding a sitewide banner to your website. This guide will walk you through building a banner and placing it above your top navigation bar using custom code.

The banner will appear like the example below:
Screen_Shot_2021-11-19_at_4.53.32_PM.png

Note: This banner won't appear on mobile devices if you have the floating footer activated.



  1. From the Websites app, select the Pages tab.

  2. In the right-hand sidebar, under Global Content, click on Footer.

  3. Click one of the (+) buttons between the content blocks and select Text from the menu.

  4. Enter your desired announcement into the Description field. You can include plain text, hyperlinks, or buttons.



Step 2: Publish and Find the Block Wrap ID

You'll need to find the unique ID for the text block you just created.

  1. Publish your site, then open it in a new browser tab.

  2. Right-click (or CTRL + click on Mac) on the banner text you added to the footer and select Inspect.

  3. In the Inspect tool, find the Block Wrap ID for your text block. It will look like a long string of letters and numbers after blockWrap_.

  4. Copy just the ID (the part after blockWrap_) and save it somewhere, as you'll need it in the next steps.
    Screen_Shot_2021-11-19_at_4.44.05_PM.png



Step 3: Add Custom CSS

  1. Select the Developer tab at the top of the page, then select CSS on the left-hand sidebar.

  2. Paste the following code into the CSS field:

    /* Sitewide Banner */

    .blockWrap_c7b6f99b274b47f5b010b83a549f1e41{
    background-color: #000000;
    color: #ffffff;
    text-align: center;
    padding: 10px;
    }

    .headerAndNavContainer{
    padding-top: 0px !important;
    }
  3. Replace the placeholder .blockWrap_c7b6f99b274b47f5b010b83a549f1e41 with the Block Wrap ID you copied in the previous step.

  4. (Optional) You can change the background and text colors by replacing the hex codes.

  5. Click Save.



Step 4: Add Custom JS

  1. Select Body JS on the left-hand sidebar.

  2. Paste the following code into the Body JS field:

    // Sitewide Banner

    $('.blockWrap_a6b2668dd95044cfbe3e7cc3153e3c4b').prependTo('.headerAndNavContainer');
  3. Replace the placeholder .blockWrap_a6b2668dd95044cfbe3e7cc3153e3c4b with the Block Wrap ID you copied.

  4. Click Save.



Step 5: Preview and Publish

After adding the code, preview your website to see how the banner looks. If it appears correctly, you can click the Publish button to make it live on your site. If the banner is not showing up, double-check that you completed each step correctly.

    • Related Articles

    • Edit Your Website's Navigation Design

      The Navigation settings in the Design panel lets you manage the appearance of your your website's navigation bar, menu items, and drop-down menus. You can choose separate settings for how your navigation menu appears on desktop and mobile devices. ...
    • Hide Header, Navigation, or Footer on a Specific Page

      You can hide the Header, Navigation, or Footer on individual pages of your website. This is useful when you want to create a page with a unique look, like a landing page or a sales page, without these standard elements. Hide Sitewide Elements on a ...
    • Edit Your Website's Header & Logo

      The Header & Logo settings in the Design panel lets you manage your website's logo, favicon, and edit the spacing and border of your website's Header. These are Sitewide settings, so any changes you make here will apply to every page on your website. ...
    • Add Cookiebot to Websites 360®

      You can set up a banner on your website that states whether you are using cookies, and how they are used. These banners are often used to comply with regulations such as the GDPR, which applies to internet users in the EU. You can add a cookie banner ...
    • Add Facebook (Meta) Pixel to Websites 360®

      You can measure the success of your Facebook Ads performance by adding the Facebook Pixel (also known as the Meta Pixel) to your website. Create your Facebook pixel If you have not yet created your Facebook Pixel, then follow these steps. If you ...