# NO BUG: \<li\> still showing in the DOM even when set to display:none

**URL:** <https://forum.bricksbuilder.io/t/no-bug-li-still-showing-in-the-dom-even-when-set-to-display-none/39989>\
**Category:** Bugs\
**Tags:** v2-3-9\
**Created:** [August 7, 2026, 2:38pm UTC](https://forum.bricksbuilder.io/t/no-bug-li-still-showing-in-the-dom-even-when-set-to-display-none/39989 "2026-08-07T14:38:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matt.S](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/m/c4cdca/32.png) [@Matt.S](https://forum.bricksbuilder.io/u/Matt.S)\
**Post date:** [August 7, 2026, 2:38pm UTC](https://forum.bricksbuilder.io/t/no-bug-li-still-showing-in-the-dom-even-when-set-to-display-none/39989/1 "2026-08-07T14:38:40Z")

</div>

There seems to be a few threads on this already, however anything I try based on any comments does not seem to work.

Issue: I have a main nav using the ‘nav items’ module. Some of the elements I wish to display on mobile but not desktop. I set those elements to display:none for desk top, they disappear however still take up space in the DOM and throw off the nav styling/spacing.

I have tried wrapping the elements in a DIV and setting the div to display:none, but whatever I try the li items remain, take up space and break the desktop menu.

Any help appreciated. This seems a silly issue to be having. Matt

---

<div class="post-metadata">

**Author:** ![aslotta](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/aslotta/32/5419_2.png) [@aslotta](https://forum.bricksbuilder.io/u/aslotta)\
**Post date:** [August 7, 2026, 4:40pm UTC](https://forum.bricksbuilder.io/t/no-bug-li-still-showing-in-the-dom-even-when-set-to-display-none/39989/3 "2026-08-07T16:40:31Z")

</div>

Try to use this in the element’s custom CSS area at the specific breakpoint:

```auto
li:has(> %root%) {
  display: none;
}

```

---

<div class="post-metadata">

**Author:** ![Matt.S](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/m/c4cdca/32.png) [@Matt.S](https://forum.bricksbuilder.io/u/Matt.S)\
**Post date:** [August 7, 2026, 5:49pm UTC](https://forum.bricksbuilder.io/t/no-bug-li-still-showing-in-the-dom-even-when-set-to-display-none/39989/5 "2026-08-07T17:49:24Z")

</div>

Thanks. I did try this already, it worked on the Bricks preview but not in the browser (Firefox).

I’ll double check my code now though.

---

<div class="post-metadata">

**Author:** ![Matt.S](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/m/c4cdca/32.png) [@Matt.S](https://forum.bricksbuilder.io/u/Matt.S)\
**Post date:** [August 7, 2026, 6:02pm UTC](https://forum.bricksbuilder.io/t/no-bug-li-still-showing-in-the-dom-even-when-set-to-display-none/39989/7 "2026-08-07T18:02:51Z")

</div>

I tried again, this time putting the CSS in the element’s Custom CSS area, and well I never it works!

I was previously trying at page level, with the intention to carry across to global once working. All I can think of is that I was not getting the selector correct. I will try again to carry across to global at some point.

Thanks for the help.

---

<div class="post-metadata">

**Author:** ![timmse](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/timmse/32/1192_2.png) [@timmse](https://forum.bricksbuilder.io/u/timmse)\
**Post date:** [August 10, 2026, 7:25am UTC](https://forum.bricksbuilder.io/t/no-bug-li-still-showing-in-the-dom-even-when-set-to-display-none/39989/9 "2026-08-10T07:25:54Z")

</div>

Hi Matt,  
Thanks so much for your report, and thanks to André for providing the solution.

I’m not exactly sure which thread(s) you’re referring to, but this one seems like a good candidate—it also offers a possible solution:

> [@How to Hide Nav (Nestable) Items on Desktop but Reveal on Mobile, Without Leaving Column Gaps](https://forum.bricksbuilder.io/t/how-to-hide-nav-nestable-items-on-desktop-but-reveal-on-mobile-without-leaving-column-gaps/38122):
>
> Hi there! I’m fairly new to Bricks Builder… So please be patient with me if I’m missing something obvious. CSS and website design is quite comfortable for me, but learning “the Bricks” way is a process. I have a menu, which I’ve setup with Nav (Nestable), that contains a few menu items that I ONLY want to show on the mobile menu. So, for these special case items, I’ve set the display: none property on Desktop and Tablet, then on Mobile Landscape (where I want the item to start showing) I set it…

> [@Matt.S](#):
>
> I tried again, this time putting the CSS in the element’s Custom CSS area…

That’s the right approach. If you place it somewhere else, you may need to adjust the selector again, since `%root%` would then likely refer to a completely different element.

Overall, this isn’t a bug. It might be a potential improvement—we’ll have to see.
