Announcement banner generator
Write your message, pick a style and colors, and copy a snippet that works on any site. The snippet has no external requests and remembers when a visitor dismisses it.
36 of 120 characters
Only http and https links are used.
Text contrast is 14.6:1 (passes WCAG AA).
Button contrast is 14.6:1 (passes WCAG AA).
Preview
Your snippet (HTML, inline CSS, a few lines of JavaScript, no external requests)
<div id="site-banner" role="region" aria-label="Announcement" style="position:fixed;z-index:2147483000;box-sizing:border-box;display:flex;align-items:center;gap:12px;font:14px/1.4 system-ui,sans-serif;padding:12px 16px;top:0;left:0;right:0;justify-content:center;background:#1e293b;color:#ffffff;"><span>We just shipped a new export screen.</span><a href="https://example.com/changelog" style="background:#ffffff;color:#1e293b;padding:6px 12px;border-radius:6px;text-decoration:none;font-weight:600;white-space:nowrap">See what's new</a><a href="https://justonecx.com/tools/announcement-banner-generator" style="color:inherit;opacity:.7;font-size:11px">by JustOneCX</a><button type="button" aria-label="Dismiss" data-banner-close style="background:none;border:0;color:inherit;font-size:20px;cursor:pointer;line-height:1">×</button></div>
<script>(function(){var b=document.getElementById("site-banner");if(!b)return;var k="banner-dismissed";try{if(localStorage.getItem(k)){b.remove();return}}catch(e){}var x=b.querySelector("[data-banner-close]");if(x)x.addEventListener("click",function(){try{localStorage.setItem(k,"1")}catch(e){}b.remove()})})();</script>
<!-- Made with the JustOneCX banner generator: https://justonecx.com/tools/announcement-banner-generator -->Paste it just before the closing body tag. Your text is escaped, so it cannot inject HTML into your page.
How it works
- Type a message of up to 120 characters and an optional link.
- Pick a top bar, bottom bar or corner card and choose colors. The page checks WCAG AA contrast.
- Copy the snippet and paste it before the closing body tag.
- Your text and link are escaped, and only http and https links are used.
Want targeting, scheduling and a changelog? See JustOneCX Announcements.
Learn moreQuestions
Is the generated banner safe to paste into my site?
The snippet makes no external requests. Your message and link text are HTML-escaped, and a link that is not http or https is replaced with a plain '#'.
Will it stay dismissed?
Yes, if you keep the dismiss button on. The snippet stores a flag in the visitor's browser storage and removes the banner on later page views.
What contrast do I need?
WCAG AA asks for at least 4.5:1 for normal text. The tool shows your ratio and warns below that.
Can I target a segment or schedule it?
Not with a static snippet. JustOneCX Announcements adds targeting, scheduling, frequency control and a changelog.
See JustOneCX working in 2 minutes
More free tools: NPS calculator · PMF survey calculator · DAU/MAU calculator · Product tour planner · CX stack checker: which chat, tour and survey tools does a site use? · How much does your customer experience tool stack cost?