Monday, May 5, 2014

position:fixed;

Imagine that the first div below was full of thousands of words of copy. How might that affect the second div?

<!DOCTYPE html>
<html>
   <body>
      <div></div>
      <div style="position:fixed; right:0; top: 100px;">
         hello!
      </div>
   </body>
</html>

 
 

It wouldn't affect the second div at all. Even as one scrolled down with the scrollbar to see all of the copy, the word hello! would still hug the right side of the browser one hundred pixels from the top.

No comments:

Post a Comment