Be the first user to complete this post
|
Add to List |
position:fixed
Overview
To design and understand the page layouts, we need to understand the position property in css. An element is said to be positioned, when its position attribute is set. position : relative || absolute || fixed || sticky (experimental);
The default value for the position attribute is static.
This post is one of the posts in the series of posts to understand the position attribute in css. Make sure to read all of them to fully understand the position attribute.An element on DOM can be categorized in one of the following categories :
- position : static || relative - element is in the normal document flow.
- position : absolute || fixed - element is absolutely positioned.
- float : left || right - element is floating. Learn More about floats.
Getting started
- Allows you to position an element on the document.
- Keeps the element fixed at its position irrespective of DOM status.
Check out James Williamson's excellent tutorial on Fixed Positioning !
[youtube https://www.youtube.com/watch?v=dB1RBFnES5A]
Also Read:
- Using css3 calc in an attribute value to compute its value at runtime
- position: relative
- window vs document
- Error handling in promises interview question