# How to turn a sticky banner into a floating one

**URL:** <https://community.hubspot.com/t/how-to-turn-a-sticky-banner-into-a-floating-one/135916>\
**Category:** CMS Development\
**Created:** [July 9, 2025, 12:52pm UTC](https://community.hubspot.com/t/how-to-turn-a-sticky-banner-into-a-floating-one/135916 "2025-07-09T12:52:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![EyadElkhatib](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/eyadelkhatib/32/207712_2.png) [@EyadElkhatib](https://community.hubspot.com/u/EyadElkhatib)\
**Post date:** [July 9, 2025, 12:52pm UTC](https://community.hubspot.com/t/how-to-turn-a-sticky-banner-into-a-floating-one/135916/1 "2025-07-09T12:52:45Z")

</div>

Hey all,

Bit of a weird question. I’ve been trying to create a sticky banner (top of screen) and wanted to know if there was any way to make it look like a floating banner instead? For further clarity, I would like it to not span the entire width of the screen and have a floaty look & feel. Is this something that’s technically possible to achieve, and if so, how can it be done?

---

<div class="post-metadata">

**Author:** ![BrandonWoodruff](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/brandonwoodruff/32/61045_2.png) [@BrandonWoodruff](https://community.hubspot.com/u/BrandonWoodruff)\
**Post date:** [July 9, 2025, 1:04pm UTC](https://community.hubspot.com/t/how-to-turn-a-sticky-banner-into-a-floating-one/135916/2 "2025-07-09T13:04:03Z")

</div>

A _sticky banner_ typically spans the full width of the screen and hugs the top, but if you’re going for more of a _floating banner_ feel — think something like a notification box or announcement bar that stays fixed in position but doesn’t stretch edge-to-edge — you’re totally in luck. Yes, it’s **technically very doable** in HubSpot with a little custom styling!

Here’s how you can do it:

### Step-by-Step to Turn a Sticky Banner into a Floating One:

1. **Use position: fixed** , but limit the width:

.floating-banner { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); width: 80%; /\* or 400px, depending on your desired look \*/ max-width: 600px; background: white; box-shadow: 0 4px 12px rgba(0,0,0,0.15); padding: 16px; border-radius: 8px; z-index: 9999; }

1. **Add this class to your custom module or banner element** inside a HubSpot theme or drag-and-drop area. If you’re using HubSpot’s Design Tools, you can pop this into a CSS file or inline style section.

2. **Optional flair:**

Let me know if this helps, or if you have any other questions!

* * *

✔ Was I able to help answer your question? Help the community by **marking it as a solution.**

| ![](https://d2qpr2jzcazej7.cloudfront.net/original/3X/d/3/d314478a36473977ed45320812b9331d25e0d3c4.jpeg) | **[Brandon Woodruff](https://www.linkedin.com/in/brandon-woody-woodruff/)**  
Senior Software Developer @ [Pearagon](https://www.pearagon.com/)Still have questions? Reach out at [brandon@pearagon.com](mailto:brandon@pearagon.com) ![](https://d2qpr2jzcazej7.cloudfront.net/original/3X/d/c/dcad77e6cf96145dd117147531ae4423b9b5cd91.png) |

* * *

###

---

<div class="post-metadata">

**Author:** ![EyadElkhatib](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/eyadelkhatib/32/207712_2.png) [@EyadElkhatib](https://community.hubspot.com/u/EyadElkhatib)\
**Post date:** [July 9, 2025, 1:46pm UTC](https://community.hubspot.com/t/how-to-turn-a-sticky-banner-into-a-floating-one/135916/3 "2025-07-09T13:46:13Z")

</div>

Hey @BrandonWoodruff , thank you! I’ll give it a go now and see how it turns out. I might pop you some follow-ups though if you don’t terribly mind.

---

<div class="post-metadata">

**Author:** ![BrandonWoodruff](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/brandonwoodruff/32/61045_2.png) [@BrandonWoodruff](https://community.hubspot.com/u/BrandonWoodruff)\
**Post date:** [July 9, 2025, 4:47pm UTC](https://community.hubspot.com/t/how-to-turn-a-sticky-banner-into-a-floating-one/135916/4 "2025-07-09T16:47:07Z")

</div>

Please do!  
Let me know, and if you found my answer helpful, mark it as a solution so others can find it!

---

<div class="post-metadata">

**Author:** ![YSharawi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/ysharawi/32/207409_2.png) [@YSharawi](https://community.hubspot.com/u/YSharawi)\
**Post date:** [July 13, 2025, 8:35pm UTC](https://community.hubspot.com/t/how-to-turn-a-sticky-banner-into-a-floating-one/135916/5 "2025-07-13T20:35:54Z")

</div>

Hey Brandon,  
Ur solution is not working for me, could you please walk me through the steps in more detail? that would be great, thank you so much!

---

<div class="post-metadata">

**Author:** ![GiantFocal](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/giantfocal/32/41969_2.png) [@GiantFocal](https://community.hubspot.com/u/GiantFocal)\
**Post date:** [July 9, 2025, 4:38pm UTC](https://community.hubspot.com/t/how-to-turn-a-sticky-banner-into-a-floating-one/135916/6 "2025-07-09T16:38:13Z")

</div>

Hi @EyadElkhatib,

Would you mind sharing the page URL?
