# Is there a way to make the background of the nav bar flow with the scrolling of the background of the body?

**URL:** <https://forum.freecodecamp.org/t/is-there-a-way-to-make-the-background-of-the-nav-bar-flow-with-the-scrolling-of-the-background-of-the-body/450918>\
**Category:** Curriculum Help\
**Tags:** css, html\
**Created:** [March 13, 2021, 5:17am UTC](https://forum.freecodecamp.org/t/is-there-a-way-to-make-the-background-of-the-nav-bar-flow-with-the-scrolling-of-the-background-of-the-body/450918 "2021-03-13T05:17:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gtrman97](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/gtrman97/32/208259_2.png) [@gtrman97](https://forum.freecodecamp.org/u/gtrman97)\
**Post date:** [March 13, 2021, 5:17am UTC](https://forum.freecodecamp.org/t/is-there-a-way-to-make-the-background-of-the-nav-bar-flow-with-the-scrolling-of-the-background-of-the-body/450918/1 "2021-03-13T05:17:48Z")

</div>

[https://codepen.io/gtrman97/full/jOVpzLw](https://codepen.io/gtrman97/full/jOVpzLw)

Current nav bar is a fixed color but the body background is a linear gradient. As I scroll along can I make the nav background match with body gradient to make it look like it’s always one background?

---

<div class="post-metadata">

**Author:** ![tlc35us](https://avatars.discourse-cdn.com/v4/letter/t/c77e96/32.png) [@tlc35us](https://forum.freecodecamp.org/u/tlc35us)\
**Post date:** [March 13, 2021, 7:05am UTC](https://forum.freecodecamp.org/t/is-there-a-way-to-make-the-background-of-the-nav-bar-flow-with-the-scrolling-of-the-background-of-the-body/450918/2 "2021-03-13T07:05:31Z")

</div>

Sounds like a transparency thing. Absolute position the nav bar to the top

- use opacity on the background color. This will give a tint to the background which you may need because the content will scroll under the nav bar as well.

- Background color none maybe, but the content scrolling underneath will interfere with seeing the content of the nav bar

Out of the two the first sounds better to me.

These are the simplest starting points. Something more complex may require Javascript.

What do you think?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [September 11, 2021, 7:06pm UTC](https://forum.freecodecamp.org/t/is-there-a-way-to-make-the-background-of-the-nav-bar-flow-with-the-scrolling-of-the-background-of-the-body/450918/3 "2021-09-11T19:06:17Z")

</div>

Closed on September 11, 2021, 7:06pm UTC

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
