# "fixed while scrolling" forces the object to the front

**URL:** <https://community.penpot.app/t/fixed-while-scrolling-forces-the-object-to-the-front/10901>\
**Category:** Ask the community\
**Tags:** fixed\
**Created:** [September 22, 2026, 3:10am UTC](https://community.penpot.app/t/fixed-while-scrolling-forces-the-object-to-the-front/10901 "2026-09-22T03:10:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![3x5](https://dub1.discourse-cdn.com/flex017/user_avatar/community.penpot.app/3x5/32/9020_2.png) [@3x5](https://community.penpot.app/u/3x5)\
**Post date:** [September 22, 2026, 3:10am UTC](https://community.penpot.app/t/fixed-while-scrolling-forces-the-object-to-the-front/10901/1 "2026-09-22T03:10:12Z")

</div>

When I create an object and then under constraints, I enable ‘Fix when scrolling’, then place another object over it which isn’t fixed, then run view mode, the fixed object is now in front of all scrolling objects. What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![ladybenko](https://dub1.discourse-cdn.com/flex017/user_avatar/community.penpot.app/ladybenko/32/6254_2.png) [@ladybenko](https://community.penpot.app/u/ladybenko)\
**Post date:** [September 22, 2026, 8:26am UTC](https://community.penpot.app/t/fixed-while-scrolling-forces-the-object-to-the-front/10901/2 "2026-09-22T08:26:02Z")

</div>

Hi! `Fix when scrolling` mimics the CSS behavior of `position: fixed`, which creates a new stacking context and therefore that layer is rendered above others.

What effect are you trying to achieve exactly in your prototype? Maybe there’s a workaround 🙂

---

<div class="post-metadata">

**Author:** ![3x5](https://dub1.discourse-cdn.com/flex017/user_avatar/community.penpot.app/3x5/32/9020_2.png) [@3x5](https://community.penpot.app/u/3x5)\
**Post date:** [September 22, 2026, 2:22pm UTC](https://community.penpot.app/t/fixed-while-scrolling-forces-the-object-to-the-front/10901/3 "2026-09-22T14:22:23Z")

</div>

Thanks for the reply. I never realized fixed elements automatically render on top. It looks like you can set `position: relative` to another element which will allow it to go over the fixed one. I don’t know if there’s a way to set relative positioning in Penpot, though.

I’m trying to create a fixed background image with a linear gradient over it. The gradient goes from transparent to black so when you scroll down the page, the background gradually disappears.
