Home  »  CodeGuidesProgrammingSnippetsTechnology   »   How to Fix Position of a div in CSS While Scrolling

How to Fix Position of a div in CSS While Scrolling

Posted: September 13, 2022 | by Michael Bright

This is how to fix position of a div in CSS to always stay in view while scrolling.

#fixed-block {
  position: fixed;
  width: 100px;
  height: 100px;
  bottom: 0;
  right: 40px;
}

Found this article interesting? Follow Brightwhiz on Facebook, Twitter, and YouTube to read and watch more content we post.