Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <style>
- br {
- line-height: 200px;
- }
- div.fixed {
- position: fixed;
- bottom: 0;
- right: 0;
- width: 300px;
- padding-left: 30px;
- border: 3px solid #73AD21;
- }
- </style>
- </head>
- <body>
- <h2>position: fixed;</h2>
- <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>
- Scroll Down<br>
- Scroll Down<br>
- Scroll Down<br>
- Scroll Down<br>
- Scroll Down<br>
- Scroll Down<br>
- End Of Page
- <div class="fixed">
- This div element has position: fixed
- </div>
- </body>
- </html>
Add Comment
Please, Sign In to add comment