

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Fixed Positioning with CSS
Fixed positioning allows you to fix the position of an element to a particular spot on the page, regardless of scrolling. Specified coordinates will be relative to the browser window.
You can use two values top and left along with the position property to move an HTML element anywhere in the HTML document.
- Move Left - Use a negative value for left.
- Move Right - Use a positive value for left.
- Move Up - Use a negative value for top.
- Move Down - Use a positive value for top.
Example
You can try to run the following code to implement fixed positioning
<html> <head> </head> <body> <div style = "position:fixed; left:80px; top:20px; background-color:blue;color:white;"> This div has fixed positioning. </div> </body> </html>
- Related Questions & Answers
- Fixed Positioning in CSS
- Fixed Positioning Using CSS
- Relative Positioning with CSS
- Absolute Positioning with CSS
- CSS Positioning Elements
- CSS positioning related properties
- Understanding CSS Positioning Methods
- Absolute Positioning in CSS
- Static Positioning in CSS
- Relative Positioning in CSS
- Static Positioning Using CSS
- Absolute Positioning Using CSS
- Relative Positioning Working in CSS
- CSS position: fixed;
- Set background image as fixed with CSS
Advertisements