Why we use Position Fixed in CSS? - Tryit Editor for Web Developers
Edit This Code:
See Result »
<html> <head> <style> div.fixed { position: fixed; bottom: 50px; right: 50px; width: 300px; border: 3px solid green; } </style> </head> <body> <h2>Position: fixed</h2> <p><b>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:</b></p> <div class="fixed"> <img src="logo.jpg"/> </div> </body> </html>
Result: