Be the first user to complete this post
|Add to List|
OverviewTo 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.
The default value for the position attribute is static.
position : relative || absolute || fixed || sticky (experimental);
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.
- 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.
- 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 !
- css specificity interview question
- css: margin does not work
- Two column layout in css
- css : center element vertically and horizontally
- pseudo elements vs pseudo classes
- position: relative
- css - circular profile pictures