# Extra Div Added - How to modify?

**URL:** <https://forums.realmacsoftware.com/t/extra-div-added-how-to-modify/47930>\
**Category:** Elements API\
**Created:** [June 5, 2025, 3:58pm UTC](https://forums.realmacsoftware.com/t/extra-div-added-how-to-modify/47930 "2025-06-05T15:58:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![logrunner](https://avatars.discourse-cdn.com/v4/letter/l/59ef9b/32.png) [@logrunner](https://forums.realmacsoftware.com/u/logrunner)\
**Post date:** [June 5, 2025, 3:58pm UTC](https://forums.realmacsoftware.com/t/extra-div-added-how-to-modify/47930/1 "2025-06-05T15:58:46Z")

</div>

I have a DevPack Navigation Bar component included within a container (id=“menuContainer”).

When I view the source code, I see an extra Div has been inserted by [Elements](https://elementsapp.io/).

```auto
<div class="rwC6D73AA3_D739_4317_BF3C_B3BA0B1FD1AB group/container group/rwC6D73AA3_D739_4317_BF3C_B3BA0B1FD1AB [&amp;>*]:col-start-1 [&amp;>*]:row-start-1 group/menuContainer z-[41] grid w-auto h-auto mt-0 mb-0 ml-auto mr-auto" id="menuContainer" data-filter-tags=""> 
   <div class="relative z-30 flex flex-col peer w-full h-auto self-center justify-self-center gap-md pt-0 pb-0 pl-0 pr-0"> 
    <!-- Menu -->
    <header class="sticky top-0 z-[9999]"> 

```

The **‘\<div class="relative z-30 …’** div has been added in with a z-index of 30. I need to be able to set that to 40 to prevent my drop-down menus in the Navigation Bar being masked by the following components.

A few questions:

- Why is this extra div added by [Elements](https://elementsapp.io/)?
- Why has it got a z-index of 30?
- How can I set the z-index to be 40 on a div I can’t access in [Elements](https://elementsapp.io/)?

If I modify the generated source code, I can get my Navigation Bar to work correctly.

As an additional question (or maybe feedback) is there a way to see the z-index settings for all the components at the same time. If not, it would be useful to be able to optionally see them listed besides the Components in the page Layout panel. 🙂

---

<div class="post-metadata">

**Author:** ![ben](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/ben/32/28488_2.png) [@ben](https://forums.realmacsoftware.com/u/ben)\
**Post date:** [June 9, 2025, 7:25am UTC](https://forums.realmacsoftware.com/t/extra-div-added-how-to-modify/47930/2 "2025-06-09T07:25:07Z")

</div>

> [@logrunner](#):
>
> Why is this extra div added by [Elements](https://elementsapp.io/)?

The **Container** component is a bit unique due to the number of features it supports. It includes a couple of internal

layers to manage its layout and layering system.

For example, if you check the **Transforms** settings on a Container, you’ll see you can apply transforms to either:

- The **entire component**
- Just the **background**
- Or only the **content**

This layered structure allows for more advanced effects — like **blurred backgrounds behind text** — and helps ensure everything works reliably across different setups. To support this, the Container also needs to manage its **own z-index stack** internally.

> [@logrunner](#):
>
> Why has it got a z-index of 30?

It’s using Tailwind’s standard z-index utility classes, which step in increments of 10 (z-0, z-10, z-20, z-30, etc.).

This particular internal layer is set to z-30 to ensure it sits at the correct visual depth relative to other components. I don’t recall the exact reason we landed on z-30 specifically — but there _was_ logic behind the choice 😅

> [@logrunner](#):
>
> How can I set the z-index to be 40 on a div I can’t access in [Elements](https://elementsapp.io/)?

You can’t directly adjust the z-index of internal container layers within Elements. That said, if you’re comfortable with JavaScript, you could target the element in the browser and apply a style override using a couple of lines of javascript.

> [@logrunner](#):
>
> I need to be able to set that to 40 to prevent my drop-down menus in the Navigation Bar being masked by the following components.

Keep in mind: even if the z-index was set to z-40, what happens if another component sets z-[41]? It’s a relative stacking game, and bumping z-index alone doesn’t always fully solve the issue — especially if nesting is involved.

Also, as a general note: when you place a component inside a Container (or any component), it inherits that component’s stacking context — which can affect how elements appear layered on the page. This flexibility is one of the powerful aspects of Elements, but it can lead to nuanced edge cases like this.

---

<div class="post-metadata">

**Author:** ![logrunner](https://avatars.discourse-cdn.com/v4/letter/l/59ef9b/32.png) [@logrunner](https://forums.realmacsoftware.com/u/logrunner)\
**Post date:** [June 9, 2025, 9:37am UTC](https://forums.realmacsoftware.com/t/extra-div-added-how-to-modify/47930/3 "2025-06-09T09:37:08Z")

</div>

> [@ben](#):
>
> You can’t directly adjust the z-index of internal container layers within Elements. That said, if you’re comfortable with JavaScript, you could target the element in the browser and apply a style override using a couple of lines of javascript.

Thanks @ben 🙂

This is the javascript code (courtesy of ChatGPT) I used to achieve this (in case anyone else has the same question):

```auto
const menuContainer = document.getElementById('menuContainer');
if (menuContainer) {
    const targetDiv = menuContainer.querySelector('div.relative.z-30.flex');
    if (targetDiv) {
        targetDiv.style.zIndex = '40';
    }
}

```

.  
ChatGPT Explanation:

```auto
Explanation:
	•	document.getElementById('menuContainer') safely grabs the parent container.
	•	querySelector('div.relative.z-30.flex') looks for the target child div with the known combination of classes. You can include more class selectors if needed for precision.
	•	We then directly change the style.zIndex property to "40".

```

> [@ben](#):
>
> This flexibility is one of the powerful aspects of Elements, but it can lead to nuanced edge cases like this.

Yes, that is true but the power of Elements is that is very customisable which means it is normally possible to find a way to achieve what you want, especially with the support users get from The RM Development Team. 👍
