Learn position property in CSS

๐ Hey! I'm Prakash Naikwadi. I have a Bachelor's degree in Computer Engineering๐คฉ
I am currently learning๐ ๐๐๐๐ ๐๐ญ๐๐๐ค ๐๐๐ฏ๐๐ฅ๐จ๐ฉ๐ฆ๐๐ง๐ญ.
๐ ๐๐ข๐ญ๐๐ฎ๐ ๐๐ซ๐จ๐๐ข๐ฅ๐: https://github.com/prakash-naikwadi
๐๐๐ซ๐ ๐๐ซ๐ ๐๐จ๐ฆ๐ ๐ฌ๐ค๐ข๐ฅ๐ฅ๐ฌ๐๐ญ๐ฌ ๐ญ๐ก๐๐ญ ๐ ๐๐จ๐ฌ๐ฌ๐๐ฌ๐ฌ๐๐...
๐
๐ซ๐จ๐ง๐ญ ๐๐ง๐:
โข HTML5 (Intermediate Level)
โข CSS (Intermediate Level)
โข JavaScript
โข React
๐๐ซ๐จ๐ ๐ซ๐๐ฆ๐ฆ๐ข๐ง๐ ๐๐๐ง๐ ๐ฎ๐๐ ๐๐ฌ: โข Java โข C โข C++
Thank you for reading. Have a wonderful day๐ค
Position property in CSS sometimes takes some time & practice to understand. Here we will see a practical way of learning CSS position properties.
Values of the position property ๐ฅ
๐ static: Every element has a static position by default, so the element will stick to the normal page flow. So if there is a left/right/top/bottom/z-index set then there will be no effect on that element.
๐ relative: an elementโs original position remains in the flow of the document, just like the static value. But now left/right/top/bottom/z-index will work. The positional properties โnudgeโ the element from the original position in that direction.
๐ absolute: the element is removed from the flow of the document and other elements will behave as if itโs not even there whilst all the other positional properties will work on it.
๐ fixed: the element is removed from the flow of the document like absolutely positioned elements. In fact, they behave almost the same, only fixed positioned elements are always relative to the document, not any particular parent, and are unaffected by scrolling.
๐ sticky (experimental): the element is treated like a relative value until the scroll location of the viewport reaches a specified threshold, at which point the element takes a fixed position where it is told to stick.
๐ inherit: the position value doesnโt cascade, so this can be used to specifically force it to, and inherit the positioning value from its parent.
Reference
https://css-tricks.com/almanac/properties/p/position/




