Guest User

Untitled

a guest
Jun 22nd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en" dir="ltr">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>CSS Example by itsRems</title>
  6. <link rel="stylesheet" href="style.css">
  7. </head>
  8. <body>
  9. <div class="top-50 fixed">
  10. <p>This text is 50 pixels away from the top border.</p>
  11. </div>
  12. <div class="left-50 fixed">
  13. <p>This text is 50 pixels away from the left border.</p>
  14. </div>
  15. <div class="right-50 fixed">
  16. <p>This text is 50 pixels away from the right border.</p>
  17. </div>
  18. <div class="bottom-50 fixed">
  19. <p>This text is 50 pixels away from the bottom border.</p>
  20. </div>
  21. <div style="text-align: center;">
  22. <p>All those paragraphs have the "fixed" position tag. That means they'll stay at that position whatever happends: scroll, resizing of the web browser,...</p>
  23. <p>If you simply want them to be at the position, use <code>position: absolute;</code></p>
  24. <p> If you want them to keep the last div's properties, use <code>position: relative;</code></p>
  25. </div>
  26. </body>
  27. </html>
Add Comment
Please, Sign In to add comment