How to make div move up and down when scrolling the page with CSS?

Sometimes, we want to make div move up and down when scrolling the page with CSS.

In this article, how to make div move up and down when scrolling the page with CSS, we will look at.

How to make div move up and down when scrolling the page with CSS?

When scrolling the page with CSS, we make the div position fixed, to make the div move up and down.
For instance, we can write

div {
  position: fixed;
}

So we can make it move as we scroll, to make the div’s position fixed.

Conclusion

When scrolling the page with CSS, we make the div position fixed, to make div move up and down.

Leave a Reply