# Custom CSS Groupfocus Offset

**URL:** <https://forum.bubble.io/t/custom-css-groupfocus-offset/191971>\
**Category:** New Responsive Engine\
**Created:** [February 16, 2022, 7:07pm UTC](https://forum.bubble.io/t/custom-css-groupfocus-offset/191971 "2022-02-16T19:07:50Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![jmalmeida](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/jmalmeida/32/120123_2.png) [@jmalmeida](https://forum.bubble.io/u/jmalmeida)\
**Post date:** [July 11, 2022, 8:05am UTC](https://forum.bubble.io/t/custom-css-groupfocus-offset/191971/7 "2022-07-11T08:05:37Z")

</div>

You’ll need the Toolbox plugin.

1. Add ids to the reference element (reference) and to the groupfocus (groupfocus).
2. Add JavascripToBubble element and enter ‘left’ as suffix, type ‘number’
3. In the workflow where you show the groupfocus, add first a Run Javascript action (it has to run before you show the groupfocus) with the following code: `var element = document.getElementById('reference'); var reference = element.getBoundingClientRect(); bubble_fn_left(reference.left + YourDynamicOffset);`
4. In the code, replace YourDynamicOffset with the dynamic offset you want
5. Add an HTML element with the code: `<style> #groupfocus { left: JavascripttoBubble A's valuepx!important; }</style>`
6. Edit: Obviously the ‘JavascriptoBubble A’s value’ has to be a dynamic expression!  
 ![Grabar_2022_07_11_10_03_04_860](https://us1.discourse-cdn.com/bubble/original/3X/f/e/fed1f1eb41117f7707402329d0e85381b43cca6e.gif)

* * *

> **Follow me on twitter**
>
> [https://twitter.com/juanmtzalmeida](https://twitter.com/juanmtzalmeida)

---

_[View the full topic](https://forum.bubble.io/t/custom-css-groupfocus-offset/191971)._
