Check out example codes for "css position sticky". It will help you in understanding the concepts better.

Code Example 1

div.sticky {
  position: -webkit-sticky; /* Safari */
  position: sticky;
  top: 0;
}

Code Example 2

h2{
 	position: absolute;
 	left: 100px;
	top: 150px;
}

Code Example 3

h2.pos_left {
  position: relative;
  left: -20px;
}

h2.pos_right {
  position: relative;
  left: 20px;
}

Code Example 4

<!DOCKTYPE html> <!-- Start of coding page -->
<html> <!-- Start of html coding -->
  <head> <!-- Start of head -->
    <title>TITLE<title> <!-- Title -->
    <script>
      //JavaScript
    </script>
    <style>
      /* CSS */
    </style>
  </head> <!-- End of head -->
  <body> <!-- Start of body -->
    <div id='mydiv' style = "position:relative; left:0px; top:100px;">
      Hello! 
      <!-- Use that style tag to positions things, have a play around with it! -->
    </div>
  </body> <!-- End of body -->
<html> <!-- End of html coding -->
<!-- Add this line of code next to your id: 

style = "position:relative; left:0px; top:100px;" 

too let you position divs where you want them, you can even position
them ontop of other divs! -->

Code Example 5

position: sticky;

Learn ReactJs, React Native from akashmittal.com