here2share

HTML position: fixed

Aug 17th, 2016
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.62 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <style>
  5. br {
  6.     line-height: 200px;
  7. }
  8. div.fixed {
  9.     position: fixed;
  10.     bottom: 0;
  11.     right: 0;
  12.     width: 300px;
  13.     padding-left: 30px;
  14.     border: 3px solid #73AD21;
  15. }
  16. </style>
  17. </head>
  18. <body>
  19.  
  20. <h2>position: fixed;</h2>
  21.  
  22. <p>An element with position: fixed; is positioned relative to the viewport, which means it always stays in the same place even if the page is scrolled:</p>
  23. Scroll Down<br>
  24. Scroll Down<br>
  25. Scroll Down<br>
  26. Scroll Down<br>
  27. Scroll Down<br>
  28. Scroll Down<br>
  29. End Of Page
  30. <div class="fixed">
  31. This div element has position: fixed
  32. </div>
  33.  
  34. </body>
  35. </html>
Add Comment
Please, Sign In to add comment